clylv
asked on
VB.NET >> EXCEL 2000
Hello,
Have a strange problem when I try to create a Workbook in excel from VB.Net(it works in VB6). the error message i get when executing the line: oWorkbook = oExcel.Workbooks.Add("C:\T emp\Templa te.xls") is: "Old Format or invalid Type library. (32792)"
I have faild trying to find out what that means, since I am using COM in both VB6 and .NET it should not precent a problem but never the less it does.
Anyone have any ideas?
(Here is the test code I use):
Dim oExcel As Excel.Application
Dim oWorkbook As Excel.Workbook
Dim sTemplate As String
oExcel = New Excel.Application()
On Error GoTo ConvertToXL_Error
oWorkbook = oExcel.Workbooks.Add()
Exit Sub
ConvertToXL_Error:
MsgBox("Error when converting to Excel." & vbCrLf & "(" & Err.Description & " (" & Err.Number & ") )")
/Claes
Have a strange problem when I try to create a Workbook in excel from VB.Net(it works in VB6). the error message i get when executing the line: oWorkbook = oExcel.Workbooks.Add("C:\T
I have faild trying to find out what that means, since I am using COM in both VB6 and .NET it should not precent a problem but never the less it does.
Anyone have any ideas?
(Here is the test code I use):
Dim oExcel As Excel.Application
Dim oWorkbook As Excel.Workbook
Dim sTemplate As String
oExcel = New Excel.Application()
On Error GoTo ConvertToXL_Error
oWorkbook = oExcel.Workbooks.Add()
Exit Sub
ConvertToXL_Error:
MsgBox("Error when converting to Excel." & vbCrLf & "(" & Err.Description & " (" & Err.Number & ") )")
/Claes
ASKER
I have solved the problem my self, the thing was that the language in my operation system was Swedish and I had an English version of Excel... go figure..
Regards
Claes
Regards
Claes
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
GoodJun,
I am not sure that you realy deserve the points since the problem was not in Excel or Excel versions but in the language-pack of the operating system, but never the less you took time to write me a hint and try my code so I think you should have the credits. in short agreed.
I am not sure that you realy deserve the points since the problem was not in Excel or Excel versions but in the language-pack of the operating system, but never the less you took time to write me a hint and try my code so I think you should have the credits. in short agreed.
I tested your code, it works. I referenced Excel 10.0 objcet library.