Home > Back-end >  Excel export, cell lines, a process cannot be released
Excel export, cell lines, a process cannot be released

Time:09-16

As title, in the code, if I don't join the line drawing code, excel process can automatically release; But, after I add draw lines of code, excel may not be able to process the release, what the devil ah, what a great god can reassure ~?

Method one:
//Temsheet Range [Temsheet cells [1, 1], Temsheet. Cells [1 dec]]. Borders [1]. The graphics.linestyle:=1;
//Temsheet Range [Temsheet cells [1, 1], Temsheet. Cells [1 dec]]. Borders. [2] graphics.linestyle:=1;
//Temsheet Range [Temsheet cells [1, 1], Temsheet. Cells [1 dec]]. Borders. [3] graphics.linestyle:=1;
//Temsheet Range [Temsheet cells [1, 1], Temsheet. Cells [1 dec]]. Borders. [4] graphics.linestyle:=1;
//Temsheet Range [Temsheet cells [1, 1], Temsheet. Cells [1 dec]]. Characters. The Font. FontStyle:='bold';
Method 2:
//range:=Temsheet. Range [Temsheet. Cells [1, 1], Temsheet. Cells 16th [1]].//selected form
//range. Borders [1]. Graphics.linestyle:=1;
//range. Borders [2]. Graphics.linestyle:=1;
//range. Borders [3]. Graphics.linestyle:=1;
//range. Borders [4]. Graphics.linestyle:=1;
//Range. Characters. The Font. FontStyle:='bold';
//range. Select;
The process of the two methods are useless, excel in,,

CodePudding user response:

This is the disadvantages of using OLE EXCEL, stuck, it is recommended to use third party controls, write EXCEL,

CodePudding user response:

Exit EXCL, release the Variant
EexcelApp. Quit;
Sheet:=the Unassigned;
ETApp:=the Unassigned;

CodePudding user response:

Exit EXCL, release the Variant
EexcelApp. Quit;
Sheet:=the Unassigned;
EexcelApp:=the Unassigned;

CodePudding user response:

This is my main code export excel, you refer to the last paragraph to release some
With FormProgress do
The begin
The Show;
Try
InitProgressState (' was generating Excel document);
VResult:=RepCreat (aExportInfo. MainTitle);
If vResult<> "' then
The begin
Raise the Exception. The Create (vResult);
end;
SetProgressState (' was generating Excel worksheets, 10);
CreatRepSheet (2, 2);
SetProgressState (' was generating title, 5);
CreatTitle (aExPortInfo);
SetProgressState (' being generated header, 5);
CreatSubHead (aExportInfo);
SetProgressState (' are written to the data, 5);//in the rest of the 70
WriteData (aExportInfo);
Are showing SetProgressState (' document ', 5);
FreeAndNil (FormProgress);
ExlApp. Visible:=True;
Except,
On E: the Exception do
The begin
FormProgress. Close;
FreeAndNil (FormProgress);
ExlApp. Quit;
ExlApp:=the unassigned;
MessageDlg (' export failed! '+ # 13 # 10 + E.M essage, mtError, [mbok], 0);
end;
end;
If FormProgress<> Nil then
FreeAndNil (FormProgress);
end;

CodePudding user response:

Temsheet. Quit;//close Excel
Temsheet:=the unassigned;
  • Related