View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Alan[_8_] Alan[_8_] is offline
external usenet poster
 
Posts: 117
Default Help! Problem Referencing Excel 2003 in VB.NET

I changed the reference to Excel 5.0 only and now only Import Excel.
I changed starting an instance of Excel to:

ExcelApp = CreateObject("Excel.Application")

The following code cannot open the workbook:

If FileExists(PathName) Then
MetaWB = ExcelApp.Workbooks.Open(PathName)

It finds that the file exists, but then the workbook cannot be opened:

A first chance exception of type
'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll

Any ideas?