QT5.9.1写入excel时:
m_pCell = m_pWorkSheet->querySubObject("Cells(int,int)", x, y); this->applyCellSettings(); //m_pCell->setProperty("Value", text); //设置单元格文字 //QString X = "A2"; //设置要操作的单元格,A1 //m_pCell->querySubObject("Range(QVariant, QVariant)", X); m_pCell->dynamicCall("SetValue(conts QVariant&)", text); // 设置单元格的值 不知道为什么setProperty("Value", text); //设置单元格文字 不能写入,改用第二种方法:
dynamicCall("SetValue(conts QVariant&)", text); // 设置单元格的值
目前成功写入,后期查找原因;