Hello everybody,
I have problem for convert .xls to .xlsm.
I use activities “move file” for rename extension but my outputfile have a problem of format, cant’ open …
Have you ever had this problem ?
Hello everybody,
I have problem for convert .xls to .xlsm.
I use activities “move file” for rename extension but my outputfile have a problem of format, cant’ open …
Have you ever had this problem ?
Hi @mateo.drouillard ,
We cannot create .xlsm by moving the file with the different extension. we can use invoke code activity and insert the below vb code to convert xls file to xlsm file with macro enabled. please refer the below code. and also please make sure that you have imported the following name space microsoft.office.interop.excel. thanks.
Dim excel As Microsoft.Office.Interop.Excel.Application
Dim wb1 As Microsoft.Office.Interop.Excel.Workbook
Dim ws1 As Microsoft.Office.Interop.Excel.Worksheet
excel = New Microsoft.Office.Interop.Excel.ApplicationClass
wb1 = excel.Workbooks.Open(“C:\Test.xlsx”)
wb1.SaveAs(“C:\Test.xlsm”,Microsoft.Office.Interop.Excel.XlFileFormat.xlOpenXMLWorkbookMacroEnabled)
wb1.Save
wb1.Close
excel.Quit
ws1 = Nothing
wb1 = Nothing
excel = Nothing
GC.Collect
Thanks @kirankumar.mahanthi1 and @Palaniyappan for yours answers. But the two solutions dosn’t work …
I have idea :
it’s possible ?
You can use Excel Application scope Read Range activity which sheet you need to write to another sheet
Now use Write Range activity and give the file name as path.xlsm
If the xlsm file is available in the path then it will write into that file, else it will create a new file
Hope this may help you
Thanks
Thanks i think its the best solution.
Do you a file.xaml for the example ?
Thanks
Can you try and let us know if you struck anywhere
Currently I don’t have the xaml file
Thanks
Thank your very much.
See you later on the forum !
Bye
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.