Announcement

Collapse
No announcement yet.

Pass a value Arabic in Excel

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Pass a value Arabic in Excel

    I use this code to pass the values ​​and words in Excel
    PHP Code:
    local sFilePath _DesktopFolder.."\\test.xls"
    if sFilePath then
        File
    .Delete(sFilePathfalsefalsefalse);
        
    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=120 do
            
    wSheet.Cells(x1).Value2 Math.Random(120); 
        
    end
        local chart 
    Excel.Charts:Add()
        
    chart.ChartType 51 
        chart
    :SetSourceData(wSheet.Range("A1:A20","A1:A20"),2)
        
    wSheet:Activate()
        for 
    x=120 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 
    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
Working...
X