-----
require("luacom")
xl = luacom.GetObject("Excel.Apploexoexcelication")
if xl == nil then xl = luacom.CreateObject("Excel.Application") end
if xl then
xl.Visible = false;
wb = xl.Workbooks:Add()
ws = wb.Worksheets(1)
end
row = 1
for col, value in pairs(t_cnames) do
ws.Cells(row, col).Value2 = value
end
for row, t_row in pairs(t_result) do
for col, value in pairs(t_row) do
if t_ctypes[col] == number then
ws.Cells(row+1, col).Value2 = value:match("^.+%s*")
else
ws.Cells(row+1, col).Value2 = "'" .. value:match("^.+%s*")
end
end
end
report_path = report_path:gsub("/", "\\")
fn_out = report_path .. filename
wb.SaveAs(report_path, fn_out)
wb = nil
xl:Quit()
xl = nil
-----
Any help or insight on this issue is greatly appreciated.
Kind regards,
Steffen
--
The best time to call me is e-mail.