Hello everyone,
I'm trying to do some job in an opened MS Excel file. I can use QAxObject to open a xls file and reading/writing it, like:
Qt Code:
  1. QAxObject m_axObjExcel("Excel.Application");
  2. m_axObjExcel.setProperty("Visible", true);
  3. QAxObject* m_pAxObjWorkBooks = m_axObjExcel.querySubObject("WorkBooks");
  4. m_pAxObjWorkBooks->dynamicCall("Open (const QString&)", m_strExcelFilePath);
  5. QAxObject* m_pAxObjWorkBook = m_axObjExcel.querySubObject("ActiveWorkBook");
  6. QAxObject* m_pAxObjWorkSheets = m_pAxObjWorkBook->querySubObject("Sheets");
  7. QAxObject* m_pAxObjWorkSheet = m_pAxObjWorkSheets->querySubObject("Item(int)", 1);
  8. QAxObject *cell = m_pAxObjWorkSheet->querySubObject("Cells(int,int)", iRowIndex, iColIndex);
  9. cell->setProperty("Value", strText);
To copy to clipboard, switch view to plain text mode 
But how can I interact with an existing MS Excel process?