Changing file type in Excel 2008 using applescript

Hi, all,

I am new to applescript and am attempting to use it to change from an .xlsx format, which Filemaker does not want to import, to an .xls file. The easiest way to do this seemed to be to write the applescript so that it opens the old file, copies the information, and then pastes it into a new spreadsheet, then saves it in the appropriate file type.

I’ve got the following code to work to a point:

set test to “Macintosh HD:Users:admin:Desktop:testInfo:newtest”
tell application “Microsoft Excel”
set newBook to make new workbook
open workbook workbook file name test
copy worksheet sheet “newtest”
paste worksheet sheet “Sheet1” in newBook
set fname to get save as filename
save workbook as newBook filename “Macintosh HD:Users:admin:Desktop:testInfo:_new” file format Excel 9795 file format
end tell

The only problem is that when it goes to save, it saves some of the code in the target file instead of the information in the spreadsheet, and leaves the information in the spreadsheet floating in Workbook 2 unsaved. Does anyone have suggestions for how to make this work so that it actually saves the active workbook?

I’ve tried variations of the above code, but that is what seems to have gotten me the farthest at this point in time. Any help would be much appreciated.