Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Active Qt Problem



  • Hello guys.

    I want to make a program which should does read datas from Excel file and write datas to Excel file. I guess I can do that with Active Qt. I cant find tutorial or good documents about Active Qt. How can i learn that?



  • "Documentation":http://qt-project.org/doc/qt-4.8/activeqt.html
    And searching this site will offer a lot of good starting points! Using the keywords: 'ActiveQt' and/or 'excel' will offer enough examples / threads. Goodluck!



  • [quote author="NL - Danny" date="1363953377"]"Documentation":http://qt-project.org/doc/qt-4.8/activeqt.html
    And searching this site will offer a lot of good starting points! Using the keywords: 'ActiveQt' and/or 'excel' will offer enough examples / threads. Goodluck![/quote]

    I am looking. I hope I can understand.



  • Keep us posted!



  • I've find two topics for you. I think they should be help you.
    http://qt-project.org/forums/viewthread/1871
    http://www.qtcentre.org/threads/9088-ActiveQt-Excel



  • I am trying to do that but I have a problem.

    @
    #include <ActiveQt/QAxWidget>
    #include <QAxObject>

    ...

    QAxObject *excel = new QAxObject( "Excel.Application", 0 );@
    Where is the problem?

    Can i make this program in MainWindow?



  • How should we know where your problem is?
    You do not even tell us what your problem is!

    If you want to, you can put all code in MainWindow.
    If it is correct to do so, is another question.



  • [quote author="NL - Danny" date="1363988058"]How should we know where your problem is?
    You do not even tell us what your problem is!

    If you want to, you can put all code in MainWindow.
    If it is correct to do so, is another question. [/quote]

    I guess You show the error when compile that code. I got errors below.

    error: undefined reference to QAxObject::QAxObject(QString const&, QObject*)' error: undefined reference toQAxObject::QAxObject(QString const&, QObject*)'
    error: collect2: ld returned 1 exit status



  • Library can not be found.
    I do not know QAxObject but there is a container activeqt, so maybe it should be added to the QT field in the pro file? Have you included the correct header?



  • You definitely right. The problem occurs because of library.

    I add the pro file the code which is below. The problem is solved.
    @CONFIG += qaxcontainer@

    I can open, save, load Excel files now. There are a kind of functions which are strange with Qt. For example when I want to write B1 Cell to 5 (int);

    @
    ...
    QAxObject *range1 = worksheet->querySubObject("Range(B1)");
    range1->setProperty("Value", QVariant(5));@

    setProperty() ,Property(), dynamicCall() functions belong Excel API? Should I learn that functions in MSDN?



  • No, the functions you mention belong to QObject / QAxBase.



  • I see. Thanks for help guys. I did the what I want :)


Log in to reply