Hello,
in my project, i need to get a value of a CELL from an Excel file and put it in a variable in the AMS project.
I use the LuaCOM plugin to convert the Excel file to XML and then i do the job
with XML.GetValue action of AMS to get the value of the cell.
That works fine but there is a little problem with the plugin Luacom because
i always have the process EXCEL.EXE who run and if i use 3 time my appli
there where 3 process EXCEL.EXE wich are never killed.
i use Excel:Quit() to finish terminate the Luacom Excel Object but don't work.
if someone have an idea, Thanks.
The beginning of the code here :
--Select the XLS file
XLS_Location = Dialog.FileBrowse(true, "Locate Excel File", "d:\\designa", "Excel Files (*.XLS)|*.XLS|", "", "XLS", false, true);
if XLS_Location ~= "CANCEL" then
--blabla
end
--Create an ExcelApp object
Excel=luacom.CreateObject("Excel.Application")
--Create a Document Object
oXLS=luacom.CreateObject("Excel.Document")
--Open Excel Document Glossary
oXLS=Excel.Workbooks:Open(XLS_Location[1])
--Hide any warning dialogs such as file overwrite dialog
oXLS.Application.DisplayAlerts = false
--Save the file as XML
oXLS:SaveAs(_TempFolder .. "\\form.xml", 46, false,false)
--Try to Close the ExcelApp but don't work (Grrrrr...)
Excel:Quit()
Excel = nil
collectgarbage()
in my project, i need to get a value of a CELL from an Excel file and put it in a variable in the AMS project.
I use the LuaCOM plugin to convert the Excel file to XML and then i do the job
with XML.GetValue action of AMS to get the value of the cell.
That works fine but there is a little problem with the plugin Luacom because
i always have the process EXCEL.EXE who run and if i use 3 time my appli
there where 3 process EXCEL.EXE wich are never killed.
i use Excel:Quit() to finish terminate the Luacom Excel Object but don't work.
if someone have an idea, Thanks.
The beginning of the code here :
--Select the XLS file
XLS_Location = Dialog.FileBrowse(true, "Locate Excel File", "d:\\designa", "Excel Files (*.XLS)|*.XLS|", "", "XLS", false, true);
if XLS_Location ~= "CANCEL" then
--blabla
end
--Create an ExcelApp object
Excel=luacom.CreateObject("Excel.Application")
--Create a Document Object
oXLS=luacom.CreateObject("Excel.Document")
--Open Excel Document Glossary
oXLS=Excel.Workbooks:Open(XLS_Location[1])
--Hide any warning dialogs such as file overwrite dialog
oXLS.Application.DisplayAlerts = false
--Save the file as XML
oXLS:SaveAs(_TempFolder .. "\\form.xml", 46, false,false)
--Try to Close the ExcelApp but don't work (Grrrrr...)
Excel:Quit()
Excel = nil
collectgarbage()
Comment