Home > Back-end >  XLSReadWrite write why there will be the last remaining content? Residual how to clean up these?
XLSReadWrite write why there will be the last remaining content? Residual how to clean up these?

Time:11-18

Such as: when I was in use XLSReadWriteII5 controls found after the call the write method, will be the last written content to write again, if so many times call write not before content has been rewritten over and over again, what method can eliminate the memory has been written about?
The following is my test code:
XLS:=TXLSReadWriteII5. Creat (Nil);
XLS. Filename:='E: \ RunData \ 123. XLSX';
XLS. Sheets [0]. AsString [0, 0] :='123';
XLS. Sheets [0]. AsString [1, 1] :='test';
XLS. Sheets [0]. AsString [2, 2] :='Hello';
XLS. Write;
XLS. Filename:='E: \ RunData \ 123-1. XLSX';
XLS. Sheets [0]. AsString (5, 5) :='Delphi';
XLS. Write;

This will find the second file also contains the content of the first file,
If I need to repeatedly in the same file to modify some of the data, the data is written before or can be repeated again and again to write?

CodePudding user response:

Add a FreeandNil (XLS) give it a try, I tried it on, and not all no problem, I use the create (application),

CodePudding user response:

XLS. Write;
Write twice? Of course is repeated, XLS content is not clear,

CodePudding user response:

refer to the second floor leavesguth response:
XLS. Write;
Write twice? Of course is repeated, XLS is not clear, the content of the


The content of the XLS how to remove? In addition to release the XLS,

Such as I think over and over again change a file, write a after each change, but don't close the file, after a period of time data update the updated data is appended to the field, before the call write at this time will put the written content to write again, is there any way before the written data released?

CodePudding user response:

The first XLS. Write; Add an XLS behind. The clear (1); Wrote 123. XLSX content is empty,

CodePudding user response:

XLS. Clear can also

CodePudding user response:

reference 1st floor leavesguth response:
add a FreeandNil (XLS) give it a try, I tried it on, and not all no problem, I use the create (application),


I use the create (application) tried, the result is the same, there are still remaining

CodePudding user response:

refer to 6th floor Not_Important response:
Quote: refer to 1st floor leavesguth response:

Add a FreeandNil (XLS) give it a try, I tried it on, and not all no problem, I use the create (application),


I use the create (application) tried, the result is the same, there are residual

This seemed to need release by hand, nil seems to have to manually release, I'm not sure

CodePudding user response:

reference 4 floor leavesguth response:
first XLS. Write; Add an XLS behind. The clear (1); Wrote 123. XLSX was emptied, and the content of the


I am going to write the same sheet, repeatedly, the above is just an experiment, I do found to have residual, now just thinking about how to get rid of residual content, may be not clear before, I'm sorry

CodePudding user response:

refer to the eighth floor Not_Important response:
Quote: refer to 4th floor leavesguth response:

The first XLS. Write; Add an XLS behind. The clear (1); Wrote 123. XLSX was emptied, and the content of the


I am going to write the same sheet, repeatedly, the above is just an experiment, I do found to have residual, now just thinking about how to get rid of residual content, may be not clear before, embarrassed


And overwrite, file is particularly slow, and accounts for resources, so want to write a put the memory, improve the write speed

CodePudding user response:

1, if the simple writing sheet as direct write directly in excel;
2, if the database is out of data, a modified into sheet, or modified you to write a write more reasonable, which is to release the XLS, directly to empty the contents of the last, also can add in front of the create a dialog to determine if fileexists (file name), then to make sure the cover the original file,
Don't know whether I understand right,

CodePudding user response:

@ Not_Important
Is XLSReadWrite cracked versions, you can send me a copy of D7 (3339501550 @qq.com), thank you

CodePudding user response:

The
reference 11 floor josencom response:
@ Not_Important
Is XLSReadWrite cracked versions, you can send me a copy of D7 (3339501550 @qq.com), thank you


I am using Berlin10.1

CodePudding user response:

 XLS:=TXLSReadWriteII5. Creat (Nil); 
XLS. Filename:='E: \ RunData \ 123. XLSX';
XLS. Sheets [0]. AsString [0, 0] :='123';
XLS. Sheets [0]. AsString [1, 1] :='test';
XLS. Sheets [0]. AsString [2, 2] :='Hello';
XLS. Write;
XLS. Sheets [0]. ClearCells;
XLS. Filename:='E: \ RunData \ 123-1. XLSX';
XLS. Sheets [0]. AsString (5, 5) :='Delphi';
XLS. Write;


Reason is wrote three Cell in the XLS, write EXCEL file first, continue to write a Cell, then write a second EXCEL file, of course, the second file, there are four Cell,
An empty Cell, between them,

Your TXLSReadWriteII5, can you pass me, want to XE10, try on, thank you: Email:[email protected]

CodePudding user response:

Your first sentence is wrong, the code should be:
XLS:=TXLSReadWriteII5. Create (Nil);

CodePudding user response:

The
reference 13 floor lyhoo163 reply:
 XLS:=TXLSReadWriteII5. Creat (Nil); 
XLS. Filename:='E: \ RunData \ 123. XLSX';
XLS. Sheets [0]. AsString [0, 0] :='123';
XLS. Sheets [0]. AsString [1, 1] :='test';
XLS. Sheets [0]. AsString [2, 2] :='Hello';
XLS. Write;
XLS. Sheets [0]. ClearCells;
XLS. Filename:='E: \ RunData \ 123-1. XLSX';
XLS. Sheets [0]. AsString (5, 5) :='Delphi';
XLS. Write;


Reason is wrote three Cell in the XLS, write EXCEL file first, continue to write a Cell, then write a second EXCEL file, of course, the second file, there are four Cell,
An empty Cell, between them,

Your TXLSReadWriteII5, can you pass me, want to XE10, try on, thank you: Email:[email protected]



I have a TXLSReadWriteII5, to?

CodePudding user response:

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related