Results 1 to 8 of 8

Thread: Qt and Excel

  1. #1
    Join Date
    Feb 2012
    Posts
    33
    Qt products
    Qt4

    Default Qt and Excel

    Hi,

    I read this thread:
    http://www.qtcentre.org/threads/8276-Excel-using-Qt

    and I read also this page:

    http://qt-project.org/forums/viewthread/1871


    In my application I wrote only this line:

    #include <QAxObject>

    ......
    .....

    QAxObject * excel = new QAxObject( "Excel.Application", 0 );

    and I have 3 errors:

    1) C:\Documents and Settings\Giuseppe\Applicativi QT\Excel-build-desktop-Qt_4_8_0_for_Desktop_-_MSVC2008__Qt_SDK__Debug\..\Excel\mainwindow.cpp:2 4: warning: C4189: 'excel' : local variable is initialized but not reference

    2) mainwindow.obj:-1: error: LNK2019: unresolved external symbol "public: __thiscall QAxObject::QAxObject(class QString const &,class QObject *)" (??0QAxObject@@QAE@ABVQString@@PAVQObject@@@Z) referenced in function "private: void __thiscall MainWindow:n_pushButton_clicked(void)" (?on_pushButton_clicked@MainWindow@@AAEXXZ)

    3) debug\Excel.exe:-1: error: LNK1120: 1 unresolved externals

    WHY ??????????????!!!!!!!!!!!!!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt and Excel

    Did you link your application against ActiveQt module?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Feb 2012
    Posts
    33
    Qt products
    Qt4

    Default Re: Qt and Excel

    No, I don't know this ActiveQt module......

    Where can I found it, and how can I link this module in my application?

    Thanks.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt and Excel

    Add the following to your project file:

    qmake Code:
    1. QT += activeqt
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Feb 2012
    Posts
    33
    Qt products
    Qt4

    Default Re: Qt and Excel

    I add the command:

    QT += core gui
    QT += xml
    QT += activeqt

    The result is the same, no difference.....

    I must to include some library in my MainWindow.cpp?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt and Excel

    Do you have activeqt.lib (or similar) in your Qt's installation lib folder?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Feb 2012
    Posts
    33
    Qt products
    Qt4

    Default Re: Qt and Excel

    No, I haven't. Do you know which one to use?

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt and Excel

    There should be qaxcontainer.lib in QTDIR/lib

    Try adding QT += qaxcontainer (and not QT += activeqt as I previously stated). Better yet just read the docs for ActiveQt, the instructiions are pretty straightforward.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Excel and Qt
    By antialias in forum Qt Programming
    Replies: 10
    Last Post: 29th October 2011, 11:42
  2. Trying to export to Excel
    By ShamusVW in forum Qt Programming
    Replies: 7
    Last Post: 4th August 2010, 08:07
  3. Automating Excel 97
    By Aki-Matti in forum Qt Programming
    Replies: 0
    Last Post: 14th December 2007, 06:28
  4. ActiveQt + Excel
    By nile.one in forum Qt Programming
    Replies: 7
    Last Post: 19th October 2007, 22:58
  5. Excel using Qt
    By nmn in forum Qt Programming
    Replies: 3
    Last Post: 28th July 2007, 02:44

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
  •  
Qt is a trademark of The Qt Company.