Hi everybody.
I opened a thread some days ago because I was trying to break all the links a workbook could have with a program developed on VB.NET.
I received an answer but I couldn't try that yet, because I just can't open any workbook, the error I get says that "The server returned an error".
I have been looking on different forums, searching the internet, there are different ways to open a file, but it seems impossible to me.
First of all, I included the reference to Excel...
"Microsoft Excel 11.0 Object library", I'm working with Office 2003.
Then, I use this code, for example:
Dim oExcel As Object
Dim oBook As Object
Dim oSheet As Object
Dim path As String
path = "C:\Workbook.xls"
oExcel = CreateObject("Excel.Application")
oBook = oExcel.Workbooks.open(path) 'This is the line where I get the error
The error I get says (I'll translate it, but I suppose you'll get it)
"Exception not controlled type: System.Runtime.InteropServices.COMException on Microsoft.visualbasic.dll
Additional information: Server launched an exception
Thanks a lot!!
Bookmarks