We have a VB.NET 2003 application which reads an Excel .xls file, manipulates the data, and then writes to a new Excel .csv file. The original programmer is no longer with the company.
I'm a .NET beginner and have never done any .NET/Excel programming. I have no experience with Interop.Excel.dll.
I set up a working directory for the source code and am attempting to step through the code from my local pc. I'm using an original .xls file with the original vb.net code... no changes have been made.
The first thing I noticed was that I did not have one of the project references: Interop.Excel.
I looked in the list of references to add it, but it was not in the the list. Finally, I browed to the bin folder where the .exe file is, and added it to my project from there. Just guessing at this point.
When I step through the code, everything seems to work fine up to this point:
When I step through that last line, an exception is generated. Execution drops down to "Catch Ex As Exception". The err.desc is "Object reference not set to an instance of an object"
I have checked and double-checked, and I am not finding the cause of this error. I'm continuing to look for a solution, and I'm hoping someone in the forum can shed some light on this.
I searched on Interop.Excel, but the results seemed not to apply to my situation.
I can't make changes to the code until I get the original code to run the way it's supposed to. As always, time is of the essence, and I'm being spread very thin as it is. Thanks.
Tracey
I'm a .NET beginner and have never done any .NET/Excel programming. I have no experience with Interop.Excel.dll.
I set up a working directory for the source code and am attempting to step through the code from my local pc. I'm using an original .xls file with the original vb.net code... no changes have been made.
The first thing I noticed was that I did not have one of the project references: Interop.Excel.
I looked in the list of references to add it, but it was not in the the list. Finally, I browed to the bin folder where the .exe file is, and added it to my project from there. Just guessing at this point.
When I step through the code, everything seems to work fine up to this point:
Code:
Dim xlApp As Excel.Application
Dim xlWB As Excel.Workbook
Dim xlWS As Excel.Worksheet
Dim ColRange As String
Dim DateRange As String
Dim CurrencyRange As String
xlWB = xlApp.Workbooks.Open(f(I).FullName)
When I step through that last line, an exception is generated. Execution drops down to "Catch Ex As Exception". The err.desc is "Object reference not set to an instance of an object"
I have checked and double-checked, and I am not finding the cause of this error. I'm continuing to look for a solution, and I'm hoping someone in the forum can shed some light on this.
I searched on Interop.Excel, but the results seemed not to apply to my situation.
I can't make changes to the code until I get the original code to run the way it's supposed to. As always, time is of the essence, and I'm being spread very thin as it is. Thanks.
Tracey