Thursday, December 13, 2018

#1 2018-11-30 01:40:21 pm

Donatelo
Member
Registered: 2018-04-06
Posts: 5

Trying to save an Excel file as a tab delimited in Excel 2016

Hi I'm trying to save an excel file as a tab delimited text file from Excel 2016.
Below is the script that I am using. I have tried a number of variations on this script but with no luck, I always get the error "Microsoft Excel got an error: Parameter error." number -50
I am pretty new to Applescript and am trying to learn by examples I find on the internet.
By all accounts the script bellow should work but does not,  Can any one tell me what I am doing wrong?

Applescript:

tell application "Microsoft Excel"
       set workbookName to (name of active workbook & ".txt")
   --save the current open workbook as a tab-delimited text file
   tell active workbook to save workbook as filename workbookName file format text Mac file format
   close active workbook saving no
end tell

Thank you very much

Model: iMac
AppleScript: 10.11.4
Browser: Firefox 61.0
Operating System: macOS 10.14


Filed under: excel, saving, Tab delimited

Offline

 

#2 2018-12-02 07:59:27 pm

t.spoon
Member
From:: BFE, Massachusetts
Registered: 2013-01-13
Posts: 368

Re: Trying to save an Excel file as a tab delimited in Excel 2016

I don't think you tell the workbook to save the workbook, I think you just tell Excel to save the workbook.

This thread may be useful:


Hackintosh built February, 2012 |  Mac OS Sierra
GIGABYTE GA-Z68X-UD3H-B3 | Core i5 2500k | 16 GB DDR3 | GIGABYTE Geforce 1050 TI 4GB
250 GB Samsung 850 EVO | 4 TB RAID
Dell Ultrasharp U3011 | Dell Ultrasharp 2007FPb

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)