Hi everyone,
I'm having a problem automating Excel XP using the Office XP Primary Interop Assemblies.
In my code I successfully instantiate an Excel Application class, and I can add a new workbook no problem. The trouble comes when I'm trying to open an existing workbook. Whenever I try to open a workbook I get the following error:
'blah.xls' could not be found. Check the spelling of the file name, and verify that the file location is correct.
If you are trying to open the file from your list of most recently used files on the File menu, make sure that the file has not been renamed, moved, or deleted.
The file does exist though. What's really weird is that when I create a new workbook using excelApp.Workbooks.Add() and save it, I can open that workbook later using excelApp.Workbooks.Open() and I won't get the error. I've looked through the existing files (that cause the error) and the ones I created from my c# code (no error) for differences that could cause this but I've gotten no-where.
Anyone have any ideas/sage-like advice?
I'm having a problem automating Excel XP using the Office XP Primary Interop Assemblies.
In my code I successfully instantiate an Excel Application class, and I can add a new workbook no problem. The trouble comes when I'm trying to open an existing workbook. Whenever I try to open a workbook I get the following error:
'blah.xls' could not be found. Check the spelling of the file name, and verify that the file location is correct.
If you are trying to open the file from your list of most recently used files on the File menu, make sure that the file has not been renamed, moved, or deleted.
The file does exist though. What's really weird is that when I create a new workbook using excelApp.Workbooks.Add() and save it, I can open that workbook later using excelApp.Workbooks.Open() and I won't get the error. I've looked through the existing files (that cause the error) and the ones I created from my c# code (no error) for differences that could cause this but I've gotten no-where.
Anyone have any ideas/sage-like advice?