Home > Software engineering >  For help, how to edit already open the excel content. Thank you
For help, how to edit already open the excel content. Thank you

Time:10-06

Now want to complete the task is, to read and write the already open excel, by the program to open the excel and editing, this can be done, but the program editing system is already open the excel is not,

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-only

CodePudding user response:

Research for a long time today, haven't not fix, continue to wait for,

CodePudding user response:

Problem solved, conveniently share
Clsids 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:

reference 4 floor onion101325 response:
problem solved, by the way share
Clsids 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 ();
can more than one user at the same time open to modify save

CodePudding user response:

Control of the excel is already open, there is no back on the same file,
  • Related