Results 1 to 3 of 3

Thread: Qt QAxObject - Find Documentation for Excell API/SDK on Cell Property,etc

  1. #1
    Join Date
    Jul 2015
    Posts
    7
    Thanks
    4
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Qt QAxObject - Find Documentation for Excell API/SDK on Cell Property,etc

    I need to integrate my Qt Application with MS Excel, I have created a class that can do the job so well but I have limited knowledge of the variables to include when dealing with the worksheet (querySubObject) and Cell Properties such as borders (Bottom Border, Top Border, Bottom Double border,etc), as well as writing images, chats, etc into the spreadsheet, headers and footers(this very important). I have searched the internet in vain. Can someone point to me how I can access these attributes so I can make my exports look elegant to the final user? Thanks.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,847
    Thanks
    270
    Thanked 787 Times in 777 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Qt QAxObject - Find Documentation for Excell API/SDK on Cell Property,etc

    The Microsoft VBA (Visual Basic for Applications) framework is the primary programming interface to Office applications. The Excel Object Model defines all of the objects that can be manipulated through VBA (which uses the underlying COM /ActiveX interface to Excel).

    This VBA-based object model is identical to the ActiveX model you can access through C++. So you can follow that documentation to get at the objects and their properties from within C++. After you #import the Excel type libraries into your C++ program, you will find that it has generated "tli" and "tlh" #include files that contain the actual C++ names for each of the corresponding VBA objects. (So "Application" becomes "_Application" for example). These are readable ASCII files and you will be able to see the complete C++-based object model in them. You'll need to learn how to read Microsoft MIDL syntax but it isn't much different from C++.

    There is a document here that gives some examples of interfacing to Excel ActiveX using C++. Skip the first 57 pages. Another example is here. Googling for "Excel C++ ActiveX examples" will give you more hits than these.

    Note that it is -not- necessary to use the Qt ActiveX framework in order to use non-GUI-based ActiveX objects from within a Qt app. You can directly #import the type libraries and use them to create ActiveX object instances inside the Excel:: namespace.

    The Qt ActiveX framework is unnecessary overhead that actually makes it much more difficult to use non-GUI ActiveX objects in a Qt app.

    Cell Properties such as borders (Bottom Border, Top Border, Bottom Double border,etc)
    For this you'll probably want to retrieve the CellFormat object for the cell (or whatever it is called in the C++ model).
    Last edited by d_stranz; 19th February 2021 at 17:41.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. The following user says thank you to d_stranz for this useful post:

    Kyef (20th February 2021)

  4. #3
    Join Date
    Jul 2015
    Posts
    7
    Thanks
    4
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: Qt QAxObject - Find Documentation for Excell API/SDK on Cell Property,etc

    Thank you very much. This is what I needed. I have gone through the links and able to identify the properties and methods that I needed urgently. In Qt, we have got the modules and API to access Ms excel and all I needed were the property and methods that can be executed to get the formats desired. Let me get this working!!

Similar Threads

  1. Replies: 0
    Last Post: 26th January 2018, 01:14
  2. Replies: 1
    Last Post: 1st July 2016, 19:47
  3. how to access QAxObject property?
    By 0BLACK0 in forum Qt Programming
    Replies: 0
    Last Post: 17th February 2015, 12:53
  4. Replies: 0
    Last Post: 2nd April 2011, 19:28
  5. Doxygen style; property documentation
    By Lykurg in forum General Discussion
    Replies: 0
    Last Post: 10th March 2009, 11:03

Tags for this Thread

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.