14875 views|3 replies

373

Posts

0

Resources
The OP
 

I would like to ask you a question about using QT to operate Excel. Please give me some advice. [Copy link]

Recently, a host computer was used in a project, so I used QT5 to make a host computer. The host computer needs to write some data to an EXCEL file. I referred to the examples on the Internet and used the QAxObject class. When opening an EXCEL file, if you use the following two sentences to set it: excel->dynamicCall("SetVisible(bool Visible)", "false"); excel->setProperty("DisplayAlerts", false); When calling QAxObject* workbook = workbooks->querySubObject("Open(const QString&)", QDir::toNativeSeparators(file0)); When opening an excel file, it will prompt QAxBase: Error calling IDispatch member Open: Unknown error, and the opening fails. If you use the following two sentences to set: excel->dynamicCall("SetVisible(bool Visible)", "true"); //excel->setProperty("WindowState", "xlMinimized"); The Excel file can be opened normally, but if the EXCEL software is not cracked, an activation prompt will pop up after opening the Excel file, which will affect subsequent read and write operations and cause file record failure. The office version I use is 2013, the QT version is 5.9, and the computer system is win7. After the upper computer software I wrote was successfully tested on my own computer, it was packaged and copied to a colleague's computer (his computer system version is win10, the office version is 2016 Home Edition, and the genuine version has been activated), and problems will occur. I don't know if you have encountered such problems.
This post is from Embedded System

Latest reply

bucuoou  Details Published on 2018-2-7 20:34

965

Posts

0

Resources
2
 
I remember there is a way to operate without installing EXCEL
This post is from Embedded System

Comments

Can you tell me about it?  Details Published on 2018-2-23 21:51
 
 

1

Posts

0

Resources
3
 
bucuoou
This post is from Embedded System
 
 
 

373

Posts

0

Resources
4
 
Shi Yu posted on 2018-2-7 13:51 I remember there is a way to operate without installing EXCEL
Can you tell me about it?
This post is from Embedded System
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list