错误如下:
QAxBase: Error calling IDispatch member Open: Exception thrown by server
Code : -2146827284
Source : Microsoft Excel
Description: ???D:\work.xls???
???
Help : xlmain11.chm
Connect to the exception(int,QString,QString,QString) signal to catch this exception
代码workbooks->dynamicCall(“Open (const QString&)”, QString(“file”))调试的时候发现workbooks为空,这句是打开file
指定的excel文档,其实原因是file指定的excel文件有问题
,可能是路径写错了,文件名写错了,该文件不存在。
注意,后缀一定要注意 .xlsx .xls .xlsm