I found on the internet many codes related to generating EXCEL worksheets in DELPHI. Here is the code I'm 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];
This part works, but when I add some information such as:
Sheet.Range['B4'] := 'M A T É R I A S - P R I M A S';
In EXCEL, you change special characters, for example:
M A T Ã R I A S - P R I M A S
Outside the lookup fields, like:
Sheet.Cells[l,2]:=dmOrcamentos.ztBaseOrcamento.FieldByName('MP_DESC').Text;
The data looks like this:
䡃㠠〬‰䅓⁅〱㠰
How can I format characters to stay as they should?