• 3774阅读
  • 1回复

Qt5 导入图片到excel问题。。在线等,急。。。。 [复制链接]

上一主题 下一主题
离线kavieen
 

只看楼主 倒序阅读 楼主  发表于: 2017-01-18
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     :
             Description:
             Help       :
         Connect to the exception(int,QString,QString,QString) signal to catch this exception
离线alexltr

只看该作者 1楼 发表于: 2017-01-18
可能是数据类型不对, 可以在excel-vba里了解一下




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

我不从事IT,只是喜欢Qt。
我不是程序员,只是与程序有缘。
我写程序,只是为了让工作变得简单有序!

                      ----  一个一直在入门的编程学习者
快速回复
限100 字节
 
上一个 下一个