Excel VBO - Save As and change file format

Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-11-16 07:15 PM
Hi,
I´m currenly working with a XLSM workbook that i would like to save as a XLSX file to remove the macros.
If I only use the standard Save As function in Excel VBO then i receive an error message:
"Internal : Could not execute code stage because exception thrown by code stage: You can not use this extension for the selected file type. Change the file extension in the File Name text box or select a different file type by changing the file format."
Please help me to modify the Code stage in Save As to be able to save the file in another file format.
Best regards,
Anton
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
30-10-18 05:41 PM
Hello Anton_Edlund,
By default Save As action you need to modify.
Copy the ""Save Workbook As"" action and create duplicate of it.
Replace wb.save(filename) to below code
wb.SaveAs(filename, 51, System.Reflection.Missing.Value,
System.Reflection.Missing.Value, false, false, 1,1, true,
System.Reflection.Missing.Value, System.Reflection.Missing.Value, System.Reflection.Missing.Value)
Publish the action and use. while passing the parameter to the action under filename parameter, please mention the filepath with xlsx extension.
Hope it will help you.
Thank you.
Regards,
Vijay Rudrappa Dodamani
