Using Excel with VB.NET give message 32792
Posted on 2005-03-11
This code gives me a strange message. I have done similar thing without problem on VB6. Why is it a problem in VB.NET. I attached COM Library 1.4 "Microsoft Excel 10.0". However every time I go back the reference disappeard again. It seems I do somehting very basic wrong here.
Dim filename As String
Dim objExcel As New Excel.Application
Dim objWrkBk As Excel.Workbook
Dim objSht As Excel.Worksheet
filename = "C:\dwgexcl"
On Error Resume Next
objWrkBk = objExcel.Workbooks.Open(filename)
Debug.WriteLine(Err.Number) ' writes 32792
Debug.WriteLine(Err.Description) ' Geting a german message on my german XP translated meaning "Old format or wrong type library"
objSht = objWrkBk.Worksheets(1)