I use this code to pass the values and words in Excel
My problem I can not pass a value in Arabic
" Line 28 "
Is there a solution to deal with this encoding
Thank you very much
PHP Code:
local sFilePath = _DesktopFolder.."\\test.xls"
if sFilePath then
File.Delete(sFilePath, false, false, false);
local Excel=luacom.CreateObject("Excel.Application")
local wBook=luacom.CreateObject("Excel.Document")
Excel.Visible = true;
local wBook=Excel.Workbooks:Add()
wBook.Title = "Test workbook"
wBook.Subject = "Little example"
wBook.Application.DisplayAlerts = False
local wSheet = wBook.Worksheets(2)
wSheet:Activate()
for x=1, 20 do
wSheet.Cells(x, 1).Value2 = Math.Random(1, 20);
end
local chart = Excel.Charts:Add()
chart.ChartType = 51
chart:SetSourceData(wSheet.Range("A1:A20","A1:A20"),2)
wSheet:Activate()
for x=1, 20 do
local curCell = wSheet.Cells(x,1)
if curCell.Value2 < 5 then
wSheet.Cells(x,2).Value2 = "This value is lower than 5"
else
wSheet.Cells(x,2).Value2 = "This value is greater than 5"
end
end
wSheet.Cells(1,3).Value2 = "ثامر"
wSheet.Cells(21,1).Formula = "=SUM(A1:A20)"
wSheet.Cells(21,2).Value2 = "This is a FORMULA!"
wBook:SaveAs(sFilePath)
end
" Line 28 "
Is there a solution to deal with this encoding
Thank you very much