P
Peter A
Visual Studio 2005. The following code was working OK with Excel 2007:
Dim xlApp As New Excel.Application
Dim wb As Excel.Workbook
If Not File.Exists(AnionSpreadsheetName) Then
MsgBox("File not found: " & AnionSpreadsheetName)
Exit Sub
End If
wb = xlApp.Workbooks.Open(AnionSpreadsheetName)
Then, because my client uses Excel 2003 I uninstalled Office 2007 and
re-installed Office 2003. Now, on the last line (the call to Open) I get
this error:
Unable to cast COM object of type
'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type
'Microsoft.Office.Interop.Excel._Application'. This operation failed
because the QueryInterface call on the COM component for the interface
with IID '{000208D5-0000-0000-C000-000000000046}' failed due to the
following error: could not be found. (Exception from HRESULT:
0x80030002 (STG_E_FILENOTFOUND)).
The file does exist and can be opened manually in Excel 2003, so I am at
a loss.
Thanks in advance,
Dim xlApp As New Excel.Application
Dim wb As Excel.Workbook
If Not File.Exists(AnionSpreadsheetName) Then
MsgBox("File not found: " & AnionSpreadsheetName)
Exit Sub
End If
wb = xlApp.Workbooks.Open(AnionSpreadsheetName)
Then, because my client uses Excel 2003 I uninstalled Office 2007 and
re-installed Office 2003. Now, on the last line (the call to Open) I get
this error:
Unable to cast COM object of type
'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type
'Microsoft.Office.Interop.Excel._Application'. This operation failed
because the QueryInterface call on the COM component for the interface
with IID '{000208D5-0000-0000-C000-000000000046}' failed due to the
following error: could not be found. (Exception from HRESULT:
0x80030002 (STG_E_FILENOTFOUND)).
The file does exist and can be opened manually in Excel 2003, so I am at
a loss.
Thanks in advance,