using DirectWrite: questions
Posted: Thu Nov 28, 2013 12:43 pm
Hello,
Thank you for you answer, I would like to clarify some items regarding my question below, it is important because I am going to use DirectWrite:
1. I understand we can write data only to one Sheet in one file using DirectWrite, correct? Reading this file to write data in other sheet is impossible because only last edited sheet will be filled, others will be cleared?
2. if I use DirectWrite to create file, why I cannot read it with Read() function? (Error occurs as I mentioned below)
----------------------------------------------------------------------------------------------------------------------------------------------
Answer:
Sorry, what you asks is not possible and will not be. DirectWrite is not intended to work in that way.
Question: is it possible to write data to some different sheets? Is somewhere an example how to do it? I try simple code
xls := TXLSReadWriteII5.Create(self);
try
xls.OnWriteCell := XLSWriteCell;
xls.Version := xvExcel2007;
xls.Filename := '1.xls';
xls.DirectWrite := True;
xls.SetDirectWriteArea(SheetIndex, 0, 4, 5, 6);
xls.Write();
File is created successfully, but when I try to write info to other sheet calling SetDirectWriteArea() with changed SheetIndex and then xls.Write() again, previously updated sheet is empty in the file.
I understood I have to call Read() method, read updated file and then write data to new sheet. But I cannot call Read(): if the file is created using DirectWrite, Read() method causes error 'Illegal use of formula string'.
Thank you for you answer, I would like to clarify some items regarding my question below, it is important because I am going to use DirectWrite:
1. I understand we can write data only to one Sheet in one file using DirectWrite, correct? Reading this file to write data in other sheet is impossible because only last edited sheet will be filled, others will be cleared?
2. if I use DirectWrite to create file, why I cannot read it with Read() function? (Error occurs as I mentioned below)
----------------------------------------------------------------------------------------------------------------------------------------------
Answer:
Sorry, what you asks is not possible and will not be. DirectWrite is not intended to work in that way.
Question: is it possible to write data to some different sheets? Is somewhere an example how to do it? I try simple code
xls := TXLSReadWriteII5.Create(self);
try
xls.OnWriteCell := XLSWriteCell;
xls.Version := xvExcel2007;
xls.Filename := '1.xls';
xls.DirectWrite := True;
xls.SetDirectWriteArea(SheetIndex, 0, 4, 5, 6);
xls.Write();
File is created successfully, but when I try to write info to other sheet calling SetDirectWriteArea() with changed SheetIndex and then xls.Write() again, previously updated sheet is empty in the file.
I understood I have to call Read() method, read updated file and then write data to new sheet. But I cannot call Read(): if the file is created using DirectWrite, Read() method causes error 'Illegal use of formula string'.