Help with simple Excel Applescript?

L

lowkey

Hi,

I am looking for some help putting together a script to open a specified
file in Excel and save it as CSV text using filename.csv.

Any takers?
 
R

r_poetic

Hi,

I am looking for some help putting together a script to open a specified
file in Excel and save it as CSV text using filename.csv.

Any takers?

Try this. http://www.microsoft.com/mac/developers has info about
scripting Office.


tell application "Microsoft Excel"

open workbook workbook file name " ....your path and name of old
file.xls or xlsx"

(*Next, active sheet is by default the sheet that appears first in the
old book; use sheet name to ask for a specific sheet to be made
active.*)
save as active sheet filename " .. your path and name of new
file.csv" file format CSV file format with overwrite

(* optional:*)
set name of active sheet to "Sheet 1"

(*next, saving no is correct but confusing*)
close active workbook saving no

end tell
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top