首页| 论坛| 消息

标题:Qt5 导入图片到excel问题。。在线等,急。。。。
作者:kavieen
日期:2017-01-18 10:45
内容:

QString strImagePath = QDir::toNativeSeparators(bmpPath);QImage image(strImagePath);
QAxObject * shapes = worksheet->querySubObject("Shapes");shapes->dynamicCall("AddPicture( QString&, bool, bool, double, double, double, double",strImagePath,false,true,1,1, image.width(),image.height());请问大侠们,这样导入图片为什么会报错呢?查了查资料也没发现问题。。。。,在线等,急。。。。。
QAxBase: Error calling IDispatch member AddPicture: Exception thrown by server
Code : 1004
Source :
[f ..


#1 [alexltr 01-18 21:50]
可能是数据类型不对, 可以在excel-vba里了解一下


QAxObject *shapes = sheet->querySubObject("Shapes");
shapes->dynamicCall("AddPicture(const QString&, single, single, single, single, single, single)",
pictureFileName, 0, 1, left+(width-width*0.88)/2.0, top+edgeSpacing,
width*0.88, height-edgeSpacing*2);

回复 发表
主题 版块