tonofsteel Posted August 13, 2003 Posted August 13, 2003 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. Quote
*Experts* Volte Posted August 13, 2003 *Experts* Posted August 13, 2003 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. Quote
tonofsteel Posted August 13, 2003 Author Posted August 13, 2003 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 Quote
Recommended Posts