Results 1 to 4 of 4

Thread: Can't save excel file with QaxObject

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Can't save excel file with QaxObject

    So guys here is my code. I sit here for hours and cannot find any solution

    QAxWidget excel("Excel.Application");
    excel.setProperty("Visible", false );
    QAxObject * workbooks = excel.querySubObject("WorkBooks");
    QAxObject *workbook = workbooks->querySubObject( "Open(const QString&)", FileName.c_str() );
    QAxObject * worksheet = workbook->querySubObject("Worksheets(int)", 1);
    worksheet->setProperty("Name", "Anlagenart1");
    //here I write into the file
    //now I want to save
    QVariant newFileName(ResultName.c_str());
    excel.setProperty("Visible", true );
    workbooks->querySubObject("SaveAs (const QString&)", ResultName.c_str());
    workbook->dynamicCall("SaveAs (const QString&)", ResultName.c_str());
    workbook->querySubObject("SaveAs (const QString&)", ResultName.c_str());
    excel.dynamicCall("SaveAs (const QVariant&)",newFileName );
    workbook->querySubObject("SaveAs (const QString&)", QString("c:\test\docbyqt.xls"));


    You can see that I tried almost every combination with no success....Please help me and save my day ^^

    EDIT:
    When I try to save it as "test.xls" ist works and the file goes to "my documents"...any other folder do not work
    Last edited by Mirmilstein; 28th March 2012 at 15:39.

Similar Threads

  1. How can I Read Write Excel File
    By xingshaoyong in forum Qt Programming
    Replies: 6
    Last Post: 13th July 2011, 20:16
  2. problem to read excel file
    By keyurparekh in forum Qt Programming
    Replies: 4
    Last Post: 27th June 2011, 13:25
  3. Formatting Excel File
    By bismitapadhy in forum Qt Programming
    Replies: 2
    Last Post: 27th May 2009, 11:16
  4. How to read Excel file with Qt
    By HelloDan in forum Qt Programming
    Replies: 3
    Last Post: 13th May 2009, 20:27
  5. Read \Write Excel File using Qt
    By xingshaoyong in forum Qt Programming
    Replies: 4
    Last Post: 27th July 2007, 22:07

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.