Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 I've narrowed it down to this only happening on computers with an older version of Excel than I have currently installed. Does anyone know why this happens and a solution that doesn't involve me installing an older version of Excel? Thanks, Luc |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error Opening Excel File in VB.NET
You can build your app against a lower version of Excel and have it work
across all versions. See "Achieving Backward Compatibility with .NET Interop: Excel as Case Study" - http://www.devcity.net/Articles/163/1/article.aspx --scott -- "Luc" wrote: 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 I've narrowed it down to this only happening on computers with an older version of Excel than I have currently installed. Does anyone know why this happens and a solution that doesn't involve me installing an older version of Excel? Thanks, Luc |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Resolve Error in opening Excel File zip file from a CD? | Excel Discussion (Misc queries) | |||
"Unable to read file" error message when opening a Excel file that contains a PivotTable report. | Charts and Charting in Excel | |||
error opening excel file | Excel Discussion (Misc queries) | |||
error opening excel file | Excel Worksheet Functions | |||
Error:Invalid File format,while opening an Excel Template file | Excel Programming |