Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Resolve Error in opening Excel File zip file from a CD? rw5400 Excel Discussion (Misc queries) 1 March 17th 10 03:41 PM
"Unable to read file" error message when opening a Excel file that contains a PivotTable report. Tim Marsden Charts and Charting in Excel 2 October 15th 05 02:10 PM
error opening excel file jp Excel Discussion (Misc queries) 2 February 17th 05 01:12 AM
error opening excel file jp Excel Worksheet Functions 0 February 16th 05 09:06 AM
Error:Invalid File format,while opening an Excel Template file Saurabh Excel Programming 1 January 17th 05 07:15 AM


All times are GMT +1. The time now is 10:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"