Hello Guys,
I have this code for opening an excel sheet using VB .Net with Excel 2000/2003. The code works fine with Win XP but gives me an error that
"Object reference not set to an Instance of an Object"
I am using the following code...
Dim oXL As Excel.Application
Dim oWB As Excel.Workbook
Dim oSheet As Excel.Worksheet
Dim oRng As Excel.Range
oXL = CType(CreateObject("Excel.Application"), Excel.Application)
oXL.Visible = True
oWB = oXL.Workbooks.Open(dlg.FileName)
oSheet = oWB.ActiveSheet
Any help will be highly appreciated.
Thanks,
Saurabh
I have this code for opening an excel sheet using VB .Net with Excel 2000/2003. The code works fine with Win XP but gives me an error that
"Object reference not set to an Instance of an Object"
I am using the following code...
Dim oXL As Excel.Application
Dim oWB As Excel.Workbook
Dim oSheet As Excel.Worksheet
Dim oRng As Excel.Range
oXL = CType(CreateObject("Excel.Application"), Excel.Application)
oXL.Visible = True
oWB = oXL.Workbooks.Open(dlg.FileName)
oSheet = oWB.ActiveSheet
Any help will be highly appreciated.
Thanks,
Saurabh