L
Lyners
Hello All,
We have a VB.NET application writen using VS 2003. This application apens an
excel file from a vendor, reads the data and performs whatever functions it
needs. We recently upgraded our sytems to Excel 2003 from Excel 2000. Our
application started erroring out because it was having a problem with opening
the Excel file.
From troubleshooting, the exact problem is in Excel 2003, it does not like
the sheet name (even though the sheet name is "sheet1"). When I open the
Excel file from my vendor using Excel 2003, I get a message box that says
"Errors were detected in 'ExcelName.xls', but Microsoft Office Excel was able
to open the file by making the repairs listed below. Save teh file to make
these reapis pernament."
Renamed invalid sheet name.
This is fine, if opening up Excel on your own, but our application is a
stand alone application that runs everyday, opens a new excel file, performs
its actions, and closes.
With Excel 2003, Our application gets as far as opening, and then errors our
with a message of: "Object reference not set to an instance of an object."
because it cannot open the file due to the error being passed back.
Is there a programmatic way around this error?
Here is my code for opening the Excel File:
Public xlApp As Object
Public xlbook As Object
Public xlsheet As Object
xlApp = CreateObject("Excel.Application")
xlbook = xlApp.Workbooks.Open(OpenFileName) <-- errors here
xlsheet = xlbook.Worksheets.Item(1)
The only solution I can come up with is, uninstall Excel 2003 from my
computer that the application is running on, and re-install Excel 2000. I
would rather try and come up with a solution to the Excel 2003 problem.
Thank you in advance for your help.
Lyners
We have a VB.NET application writen using VS 2003. This application apens an
excel file from a vendor, reads the data and performs whatever functions it
needs. We recently upgraded our sytems to Excel 2003 from Excel 2000. Our
application started erroring out because it was having a problem with opening
the Excel file.
From troubleshooting, the exact problem is in Excel 2003, it does not like
the sheet name (even though the sheet name is "sheet1"). When I open the
Excel file from my vendor using Excel 2003, I get a message box that says
"Errors were detected in 'ExcelName.xls', but Microsoft Office Excel was able
to open the file by making the repairs listed below. Save teh file to make
these reapis pernament."
Renamed invalid sheet name.
This is fine, if opening up Excel on your own, but our application is a
stand alone application that runs everyday, opens a new excel file, performs
its actions, and closes.
With Excel 2003, Our application gets as far as opening, and then errors our
with a message of: "Object reference not set to an instance of an object."
because it cannot open the file due to the error being passed back.
Is there a programmatic way around this error?
Here is my code for opening the Excel File:
Public xlApp As Object
Public xlbook As Object
Public xlsheet As Object
xlApp = CreateObject("Excel.Application")
xlbook = xlApp.Workbooks.Open(OpenFileName) <-- errors here
xlsheet = xlbook.Worksheets.Item(1)
The only solution I can come up with is, uninstall Excel 2003 from my
computer that the application is running on, and re-install Excel 2000. I
would rather try and come up with a solution to the Excel 2003 problem.
Thank you in advance for your help.
Lyners