Problems with Excel 2000

a_jam_sandwich

Well-known member
Joined
Dec 10, 2002
Messages
367
Location
Uk
Currently I have a problem with excel running the code below works on Excel 2002 but on Excel 2000 is creates and exception

nullreferenceexception : Object reference to set to instance of object

Im using the 10.0 excel comm object

Code:
oExcel As New Excel.Application

 This is the line where it fails to open the file.
oExcel.Workbooks.OpenText("C:\test.csv", Type.Missing, 1, Excel.XlTextParsingType.xlDelimited, _
Excel.XlTextQualifier.xlTextQualifierNone, _
Type.Missing, Type.Missing, Type.Missing, True, Type.Missing, _
Type.Missing, Type.Missing, Type.Missing, Type.Missing, _
Type.Missing, Type.Missing, Type.Missing, Type.Missing)  (Filename, StartRow:=3, DataType:=Excel.XlTextParsingType.xlDelimited, Comma:=True)

oExcel.visible = True

oExcel = Nothing

Anyone have any ideas?

Thx

Andy
 
For anyone who may of experienced the problem above the problem occurs using 10.0 excel object in Excel 2000.

The way I have solved this is to late bind the excel object and sure enough worked perfectly

Andy.
 
Back
Top