Hi,
My computer is installing 2 versions of excel10 and excel16.
I use the following code to get the running excel instance but it only recognizes excel10.
I don't know what is the purpose of
Although when I run the code, I always get pDisp!=nullptr but I can't query to workbooks from m_XLApp,...
How I can fix this error?
Many thanks!
My computer is installing 2 versions of excel10 and excel16.
I use the following code to get the running excel instance but it only recognizes excel10.
Code:
LPWSTR pszExcelPath =
L"C:\\Program Files\\Microsoft Office\\root\\Office16\\EXCEL.EXE";
CreateProcess(pszExcelPath, NULL, 0, 0, 1,
NORMAL_PRIORITY_CLASS, 0, NULL, &Start, &ProcInfo);
Code:
for (int j = 1; j <= 5; j++)
Code:
m_XLApp.Attach(static_cast<Interface*> pDisp,true );
if (pUnk)
pUnk->Release();
wstring s{ m_XLApp->Caption }; <<--vs crash then out debugging.
Many thanks!