Home > Back-end >  CShapes. AddPicture () function to Excel process can't automatically shut down
CShapes. AddPicture () function to Excel process can't automatically shut down

Time:09-20

In the use of VS save Excel used in the process of the save image features, calls the AddPicture Excel process after () function does not close on its own, must turn off the program, Excel process will close together with the program,
Code to add myExcelApp. Put_Visible (TRUE); Found the window of the Excel and interface can be closed, but there is no interface will still remain a Excel process, now can only use ShellExecute forcibly closed Excel process,

NumChangeAA (indexX indexY);//convert to Excel coordinate corresponding
WriteRange=startRange. Get_Range (COleVariant (outChar), COleVariant (outChar));//outchar to obtain the coordinates of the
Shaps=sheet. Get_Shapes ();
Shaps. AddPicture (picPath, false, true, (float) writeRange. Get_Left () dblVal, (float) writeRange. Get_Top () dblVal, writeRange. Get_Width () dblVal, writeRange. Get_Height () dblVal);
WriteRange. ReleaseDispatch ();
Shaps. ReleaseDispatch ();

Shut down and release the same procedure, do not use the shaps AddPicture () is to be shut down process,

Is there a way to shut down by the Excel method and now is the case with an unknown graphical interface have closed Excel process, don't know what is going wrong,
  • Related