It should be possible to do all of this. I have done it in the past with other QAx objects for Word and other ActiveX / COM objects.
Just remember to match any call that creates a COM instance with a call to delete or close it so the objects (and the files they represent) don't get locked open when your program exits. The easiest way is to use smart pointers wherever possible.
Note that you are not limited to using QAxObject if you want to use Excel or other ActiveX objects in your Qt programs. Qt is just C++, so anything you can do in an ordinary C++ program you can also do in a Qt-based C++ program.
You can use the #import directive in your source code to create ".tlb" and ".tli" files that directly create C++ smart pointer interfaces to the ActiveX objects.
Here is one link that explains how to do that. And here's a link to a PDF document that gives examples starting on page 53.
In doing it directly as described in the links, you are using smart pointers that will "clean up" after themselves and ensure that everything you access will be properly closed or destroyed.
Bookmarks