How to convert Excel xlsx to xls with Automator with Office 2016

So, MS have removed Automator functions for Excel 2016. Thanks.

Note, my output filename is hardcoded because I use this file for printing labels with a Dymo Labelwriter that needs to know the filename before hand.

Here’s my workaround:

on run {input, parameters}

set docFolder to path to documents folder as text
set old_file_name to input as text
set new_file_name to docFolder & "new-file.xls" as text

tell application "Microsoft Excel"
set theWorkbook to open workbook workbook file name old_file_name
set theWorksheet to worksheet 1 of theWorkbook
save as theWorksheet filename new_file_name file format Excel98to2004 file format with overwrite
close active workbook

end tell

return docFolder
end run

Post navigation

Leave a Reply

Your email address will not be published. Required fields are marked *

+ nine = 18