Probleme saving xls file with C#

F

Folkien

Hello every body,

I'm working with VS 2005 pro, excel 2003, windows xp sp2

I made a programme to modify cells in an excel workbook. The idea is to
open an existing xls file and modify cells, and finaly save the
workbook with a different file name.

The problem i have is that the file I saved dosen't have the
modification I did. I checked the workbook object juste befor the
workbook.saveAs(...) methode and it has the good values. beside when I
run my programe with excel = visible, I see all the modification being
made, if I do by hand File->Save As ... the workbook is saved WITH the
modifications.

here is my methode to save the file :

System.Threading.Thread.CurrentThread.CurrentCulture = new
System.Globalization.CultureInfo("en-US");
excelWorkbook.SaveAs(
fileName,
Excel.XlFileFormat.xlWorkbookNormal,
xlmissing,
xlmissing,
xlfalse,
xlfalse,
Excel.XlSaveAsAccessMode.xlNoChange,
xlmissing,
xlmissing,
xlmissing,
xlmissing,
xlfalse);

I tried different parameters, but nothing changed. I know that the
excel file has been made on a excel 97 french version and I'm using an
excel 2003 english version.

Please help me on that probleme, I'm stucked for a long time know...
 
F

Folkien

I found the probleme, I have a macro in the document that modified the
cell I accesed and write the old value...

thx any way

I have know to find the way from C# to modify the macros of my excel
workbook, any one has an idea ? that would be great
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top