Answer the question
In order to leave comments, you need to log in
Qt, Excel crashes when selecting a work page?
QAxObject* excel = new QAxObject( "Excel.Application", 0 );
excel->dynamicCall("SetVisible(bool)",true);
QAxObject *workbooks = excel->querySubObject( "Workbooks" );
QAxObject *workbook = workbooks->querySubObject("Add()");
QAxObject *sheets = workbook->querySubObject( "Worksheets" );
QAxObject *sheet1 = sheets->querySubObject( "Item( int )", 1 );
sheet1->dynamicCall("SetName(const QString&)", QVariant("Лист1"));
QAxObject *sheets = workbook->querySubObject( "Worksheets" );
Answer the question
In order to leave comments, you need to log in
This code works for me with Qt 5.6 and MS Excel 2013.
So you have some problems with the office.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question