D
David Krmpotic
hi!!
I use the following code to operate excel document:
Excel.Application excelApp = new Excel.ApplicationClass();
//excelApp.Visible = true;
string workbookPath = "c:\\eltina.xls";
Excel.Workbook excelWorkbook =
excelApp.Workbooks.Open("eltina.xls",0,false,5,"","",false,Excel.XlPlatform.
xlWindows,"\t",false,false,0,false);
//Workbooks.Open(workbookPath, 0, false, 5, "", "", false,
Excel.XlPlatform.xlWindows, "",true, false, 0, true, false, false);
//this is from http://www.codeproject.com/csharp/csharp_excel.asp, but it
doesn't compile in my VS.NET 2003 ?? it says "there is no overload method
which accepts 15 parameters
Excel.Sheets excelSheets = excelWorkbook.Worksheets;
string currentSheet = "List1";
Excel.Worksheet excelWorksheet =
(Excel.Worksheet)excelSheets.get_Item(currentSheet);
Excel.Range excelCell = (Excel.Range)excelWorksheet.get_Range("A1", "A1");
I get this error:
-------------------------------------------------------
An unhandled exception of type 'System.Runtime.InteropServices.COMException'
occurred in BorisExcel.exe
Additional information: 'eltina.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.
-------------------------------------------------------
and it happens at line with: excelApp.Workbooks.Open(..
But file *does* exist! Please help.. I've already spent too much time in
opening one simple excel document trying to read cells content from
worksheet.
Thank you sooo much !
David
I use the following code to operate excel document:
Excel.Application excelApp = new Excel.ApplicationClass();
//excelApp.Visible = true;
string workbookPath = "c:\\eltina.xls";
Excel.Workbook excelWorkbook =
excelApp.Workbooks.Open("eltina.xls",0,false,5,"","",false,Excel.XlPlatform.
xlWindows,"\t",false,false,0,false);
//Workbooks.Open(workbookPath, 0, false, 5, "", "", false,
Excel.XlPlatform.xlWindows, "",true, false, 0, true, false, false);
//this is from http://www.codeproject.com/csharp/csharp_excel.asp, but it
doesn't compile in my VS.NET 2003 ?? it says "there is no overload method
which accepts 15 parameters
Excel.Sheets excelSheets = excelWorkbook.Worksheets;
string currentSheet = "List1";
Excel.Worksheet excelWorksheet =
(Excel.Worksheet)excelSheets.get_Item(currentSheet);
Excel.Range excelCell = (Excel.Range)excelWorksheet.get_Range("A1", "A1");
I get this error:
-------------------------------------------------------
An unhandled exception of type 'System.Runtime.InteropServices.COMException'
occurred in BorisExcel.exe
Additional information: 'eltina.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.
-------------------------------------------------------
and it happens at line with: excelApp.Workbooks.Open(..
But file *does* exist! Please help.. I've already spent too much time in
opening one simple excel document trying to read cells content from
worksheet.
Thank you sooo much !
David