troubleshooting Question

VB.NET >> EXCEL 2000

Avatar of clylv
clylv asked on
.NET Programming
4 Comments1 Solution763 ViewsLast Modified:
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:\Temp\Template.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
ASKER CERTIFIED SOLUTION
GoodJun

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros