+ Reply to Thread
Results 1 to 4 of 4

Probleme saving xls file with C#

  1. #1
    Folkien
    Guest

    Probleme saving xls file with C#

    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...


  2. #2
    Folkien
    Guest

    Re: Probleme saving xls file with C#

    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


  3. #3
    NickHK
    Guest

    Re: Probleme saving xls file with C#

    This will show you the VB way:
    http://www.cpearson.com/excel/vbe.htm

    NickHK

    "Folkien" <[email protected]>
    ???????:[email protected]...
    >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
    >




  4. #4
    Folkien
    Guest

    Re: Probleme saving xls file with C#

    thx I'm reading the page you posted. I will see if I can make it in C#
    with this


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1