General Macro Scheduler discussion
Moderators: Dorian (MJT support), JRL
-
Grovkillen
- Automation Wizard
- Posts: 1034
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
-
Contact:
Post
by Grovkillen » Tue Sep 27, 2016 6:20 am
Hi there,
I have a hard time to get the XLSave to work. I want to save a .xlsx file as .xls but the following code will not generate a file at the XLSave step. I have looked in the manual but it seems not to work the way I interpret the help text. Please give me a hint of what I do wrong. Thanks!
Code: Select all
XLOpen>H:\Filename.xlsx,0,xlBook
XLSave>xlBook,H:\Filename.xls,43
XLQuit>xlBook
WaitProcessTerminated>EXCEL.EXE
XLSheetToArray>H:\Filename.xls,SheetName,sheetArray
MDL>sheetArray_1_1
Further reading:
XLSave in manual
-
Marcus Tettmar
- Site Admin
- Posts: 7380
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
-
Contact:
Post
by Marcus Tettmar » Tue Sep 27, 2016 9:08 am
Not sure that 43 is the right code for .xls. I would have thought you want xlExcel8 which is 56. I wrote this code to open the sample .xls file which comes with Macro Scheduler, save it to a xlsx file and then save that back to an xlExcel8 xls file:
Code: Select all
XLOpen>%SCRIPT_DIR%\samples\example.xls,1,xlH
XLSave>xlH,%SCRIPT_DIR%\samples\new_example.xlsx,51
XLSave>xlH,%SCRIPT_DIR%\samples\old_format.xls,56
Works fine.
-
Grovkillen
- Automation Wizard
- Posts: 1034
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
-
Contact:
Post
by Grovkillen » Tue Sep 27, 2016 10:21 am
Great, it worked now. Thanks for that. I didn't know that "xlExcel8" would be the correct setting since it was prior to "xlExcel9795" in the list.
I suggest you update the manual with your code as an extra example. Thanks!