Open Excel Error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

VB.NET 2k3 using these statements:

Dim ThisApplication As Excel.Application
ThisApplication.Workbooks.Open("C:\Program Files\97CS\SelfInspect
1.0\NewForm27.xls")

Statements look good then I debug and it gives me:

An unhandled exception of type 'System.NullReferenceException' occurred in
CSInspector.exe

Additional information: Object reference not set to an instance of an object.

On Break I have to view the disassembly (which is way over my head) an arrow
points to:

0000001d mov eax,dword ptr [ecx]


Anyone have ideas on what this means???
 
brix_zx2 said:
VB.NET 2k3 using these statements:

Dim ThisApplication As Excel.Application

You are never assigning an instance of 'Excel.Application' to the variable
'ThisApplication'.

\\\
Dim ThisApplication As New Excel.Application()
///
 
Back
Top