Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I use this code in a public function in the main form, as it needs to be used in several completely different occations. It works perfect if i but it in a button, but as soon as it is inside a function I call..... trajedy:

               If WriteString <> Nothing Then
                   xlSheet.Cells(yer, counter - (10 - i)) = WriteString
               End If

 

And I get this error:

 

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll

 

Additional information: Exception from HRESULT: 0x800A03EC.

  • *Experts*
Posted
Are you making sure that the file you are trying to write to is not open already, and that it is not read-only? I believe that particular error means "Could not open the file for writing" or something like that. I didn't get many results on Google, but that's what I could gather.
Posted

Ah yes, that was the problem. I just made another instance of excel (instead of another sheet in the current book, or another book) and put the new info into there. Works perfect now.

 

Thank you

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...