别说是
QAxObject *presentation = presentations->querySubObject("Open (const QString&, int, int, int)",d->inputFile, 0, 0, 0);
if (presentation) ...我想一次判断所有相关操作是否可用
2 个解决方案
#1
没人啊,自己顶
#2
一次判断所有操作是否可用可能不行。
这个我操作excel的代码,你参考下
这个我操作excel的代码,你参考下
QAxWidget excel("Excel.Application");
excel.setProperty("Visible", false);
QAxObject * workbooks = excel.querySubObject("WorkBooks");
workbooks->dynamicCall("Add");
QAxObject * workbook = excel.querySubObject("ActiveWorkBook");
QAxObject * worksheet = workbook->querySubObject("Worksheets(int)", 1);
QAxObject * range;
range = worksheet->querySubObject("Range(const QVariant&)",QVariant(QString("D:D")));
range->dynamicCall("select()");
range->setProperty("NumberFormat","yyyy/m/d h:mm:ss");
range = worksheet->querySubObject("Cells(int,int)",1,1);
range->dynamicCall("select()");
#1
没人啊,自己顶
#2
一次判断所有操作是否可用可能不行。
这个我操作excel的代码,你参考下
这个我操作excel的代码,你参考下
QAxWidget excel("Excel.Application");
excel.setProperty("Visible", false);
QAxObject * workbooks = excel.querySubObject("WorkBooks");
workbooks->dynamicCall("Add");
QAxObject * workbook = excel.querySubObject("ActiveWorkBook");
QAxObject * worksheet = workbook->querySubObject("Worksheets(int)", 1);
QAxObject * range;
range = worksheet->querySubObject("Range(const QVariant&)",QVariant(QString("D:D")));
range->dynamicCall("select()");
range->setProperty("NumberFormat","yyyy/m/d h:mm:ss");
range = worksheet->querySubObject("Cells(int,int)",1,1);
range->dynamicCall("select()");