CodePudding user response:
Personally think the main problem is to find you already open the excel process APP object,Thinking:
Use CreateInstance process of this method to create excel process, if the excel process exists, remember correctly should return already open the excel process APP object,
CodePudding user response:
Should not have to open the EXCEL you can open the edit saved at the same time operating unsafe only read-onlyCodePudding user response:
Research for a long time today, haven't not fix, continue to wait for,CodePudding user response:
Problem solved, conveniently shareClsids clsids;
LPDISPATCH pDisp;
IUnknown * pUnk;
CLSIDFromProgID (L "Excel Application", & amp; Clsids);
GetActiveObject (clsids, NULL, & amp; PUnk);
PUnk - & gt; QueryInterface (IID_IDispatch, (LPVOID *) & amp; PDisp);
App. AttachDispatch (pDisp);
PUnk - & gt; Release ();
CodePudding user response: