I wrote a VB .NET program that opens an Excel Workbook to put some values. Here is the code that open the file:
OpenFileDialog1.FileName = ""
OpenFileDialog1.Filter = "Excel files (*.xls)|*.xls"
OpenFileDialog1.ShowDialog()
filePath = OpenFileDialog1.FileName
If System.IO.File.Exists(filePath) Then
oExcel = CreateObject("Excel.Application")
oExcel.Visible = True
oBook = oExcel.Workbooks.Open(filePath)
End If
This worked well until I had to run it on an old computer wich didn't have .NET Framework 4.5 nor 4.0
I then change the Framework target to 3.5 and it gave me this error when running:
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in Microsoft.VisualBasic.dll
Additional information: Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))
I guess the way to open an Excel file is not the same for 3.5 or 4.5 so I don't know how I should do.