Thanks for replying, here is the code :
=======================================================
private Excel.Application ExcelObj = null;
public Form1()
{
// Initialize the Windows Components
InitializeComponent();
ExcelObj = new Excel.Application();
// See if the Excel Application Object was successfully constructed
if (ExcelObj == null)
{
MessageBox.Show("ERROR: EXCEL couldn't be started!");
System.Windows.Forms.Application.Exit();
}
}
private void menuItem2_Click(object sender, System.EventArgs e)
{
// *** open the workbook --> it goes wrong on this line
Excel.Workbook theWorkbook =
ExcelObj.Workbooks.Open("c:\counter.xls",Type.Missing, Type.Missing,
Type.Missing,Type.Missing,Type.Missing, Type.Missing,
Excel.XlPlatform.xlWindows, Type.Missing,Type.Missing,
Type.Missing,Type.Missing, Type.Missing);
// *** get the collection of sheets in the workbook
Excel.Sheets sheets = theWorkbook.Worksheets;
// *** get the first and only worksheet from the collection of worksheets
Excel.Worksheet worksheet = (Excel.Worksheet)sheets.get_Item(1);
....
}
===============================================================
concerning the primary interop assemblies, under VS.Net I choose project>add
a reference>COM and then I select "Microsoft Excel 9 Object Librairy",
filename is "excel9.olb" ; it puts the interop.excel.dll and
interop.office.dll in my project folder... I have problem to understand the
what is Interop...
Thanks for your help
_____________________________________________________________________
"Morten Wennevik" <
[email protected]> a écrit dans le message de
oprxs3y0dbhntkfz@localhost...
It might help if you would post some code of the problem.
My guess is that what you are trying to send to excel isn't something
excel can handle.
Not sure what changing cultureinfo would fix. Then again, some code would
be helpful.