3
I found on the internet many codes related to generating EXCEL spreadsheets in DELPHI. Follow the code I am using:
objExcel := CreateOleObject('Excel.Application');
objExcel.Visible := True;
objExcel.Workbooks.Add;
objExcel.Workbooks[1].Sheets.Add;
objExcel.Workbooks[1].WorkSheets[1].Name := 'Orçamento';
Sheet := objExcel.Workbooks[1].WorkSheets[1];
That part works, but when I add some information, like:
Sheet.Range['B4'] := 'M A T É R I A S - P R I M A S';
In EXCEL changes the special characters, for example, to:
M A T Ã R I A S - P R I M A S
Outside the fields lookup, as:
Sheet.Cells[l,2]:=dmOrcamentos.ztBaseOrcamento.FieldByName('MP_DESC').Text;
that the data stays like this:
䡃㠠〬‰䅓⁅〱㠰
How can I format the characters to look like they should?
Checked if the contents of dmOrcamentos.ztBaseOrcamento.Fieldbyname('MP_DESC'). Text is correct ?
– wesley luan