XLSave file format not really explained in manual

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Grovkillen
Automation Wizard
Posts: 1023
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

XLSave file format not really explained in manual

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
Let>ME=%Script%

Running: 15.0.24
version history

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: XLSave file format not really explained in manual

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.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Grovkillen
Automation Wizard
Posts: 1023
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: XLSave file format not really explained in manual

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!
Let>ME=%Script%

Running: 15.0.24
version history

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts