Home > Back-end >  C builder OLE thread interrupt how to end after EXCEL operation EXCEL, speaking, reading and writing
C builder OLE thread interrupt how to end after EXCEL operation EXCEL, speaking, reading and writing

Time:10-12

New to C + builder, OLE way to read and write EXCEL, EXCEL all normal operation
But if the execution of the program, click exit key discovery program exits, but Excel process is not over yet,
I am in FormClose method to release the Thread Thread, but always end not Excel method,
Please help warrior!!!!!!

CodePudding user response:

The Variant Ex, Wb, Sheet;
The Ex=the Variant: : CreateObject (" Excel. Application ");
Ex. OlePropertyGet (" WorkBooks "). OleProcedure (" Open ", ExcelFileName c_str ());
Wb=Ex. OlePropertyGet (" ActiveWorkBook ");
Sheet=Wb. OlePropertyGet (" ActiveSheet ");

Add the following three, should be able to,

The Ex=Unassigned;
Wb=Unassigned;
Sheet=Unassigned;

CodePudding user response:

I write these three on FormClose will go wrong,,,,,,,

CodePudding user response:

refer to the second floor chikk response:
I write these three on FormClose will go wrong,,,,,,,



Not in FormClose writing, at the end of the code for handling excel part (the back) plus

CodePudding user response:

reference KFRGHT reply: 3/f
Quote: refer to the second floor chikk response:

I write these three on FormClose will go wrong,,,,,,,



Is not written in FormClose, excel in operation (the back) at the end of the code and it is ok to


Normal program execution can be, but I intentionally closed Form now, I found the Excel residual in the process

CodePudding user response:

I also is such a project, attention!

CodePudding user response:

Attention, the great god to answer quickly