I want to use a "normal" (with Excel created) file as a template. So my customers can create their own designs for output.
My program uses two XLSReadWriteII components. One to read the template file and one to create the new output-file.
In the template file, each cell is already formated (currency, float, date, font color, border ect.).
It should work like this (I know this aren't the correct commands, but they show what I want to do):
Code: Select all
XLSTemplate.FileName:='c:\template.xls';
XLSTemplate.Read;
myFormat := XLSTemplate.Sheet[0].GetFormat['A1'];
XLSOutPut.Sheet[0].AsString['A1'] := '24';
XLSOutPut.Sheet[0].SetFormat['A1'] := myFormat;
XLSOutPut.FileName :='myoutput.xls';
XlsOutPut.Write;
It would be fine, if fontstyle, font color ect. will be copied, too.
Has anyone an idea how this can be done ??
Regards,
Rainer