Error Opening Excel File in VB.NET
Hi, I have an application that reads in a bunch of values from an excel application. Now this works fine on my computer but when I deploy it to a few other computers, some of them return an 'Object Reference not set to an instance of an object' error when I open it.
Here is my code...
Dim ExcelApp As Excel.Application
Dim ExcelBook As Excel.Workbook
ExcelApp = New Excel.Application
ExcelBook = ExcelApp.Workbooks.Open(Filename) ' error is here
Keep in mind that this code works on some computers, just not all of them.
Thanks,
Luc
[611 byte] By [
lucbrunet] at [2007-11-11 8:49:14]

# 1 Re: Error Opening Excel File in VB.NET
Did you add the Excel object library reference to your project? Did you include the Excel interop file in the bin folder when you distributed the app?
# 2 Re: Error Opening Excel File in VB.NET
Yes I added the object reference but I didn't add anything extra to the bin folder. When I install it, there is an interop excel file and also an Excel App file in the bin directory.
It seems that if I install it on a computer with the same version of Excel as mine (11.0), then it works fine. I don't know how to revert to an older version such as 9.0 in order to see if that would work. Any ideas?
Thanks!
Luc