Applescript save as CSV

P

pinkfish.jm

Hi,
At the end of my Applescript, I have a line to save as CSV.

save workbook as active workbook filename "finish.csv" file format CSV
file format

When I try to open up "finish.csv" in a text editor, it gives me a
bunch of excel garbage. Why isn't it saving as in CSV format?

(I'm using Excel 2004.)

Melissa
 
P

Paul Berkowitz

Hi,
At the end of my Applescript, I have a line to save as CSV.

save workbook as active workbook filename "finish.csv" file format CSV
file format

When I try to open up "finish.csv" in a text editor, it gives me a
bunch of excel garbage. Why isn't it saving as in CSV format?

(I'm using Excel 2004.)


You shouldn't try to save a workbook as CSV. (When I try, it won't even open
in TextEdit, only in Excel.) Since the most you can ever save as CSV is only
one worksheet at a time, use 'save as' command rather than 'save workbook
as'. I tried it with the same sheet and it works perfectly. It opens in
TextEdit looking exactly the same as doing it in the UI.

Also, by 'filename' it actually means the full colon-delimited file path,
although it will save it to the folder where you last saved a document if
you use just the actual name as you did.

Try


save as active sheet filename "finish.csv" file format CSV
file format


I agree that it's a bug to allow the CSV file format (and probably several
other file formats such as the text formats) to operate with 'save workbook
as' and then have it not save properly. I'll file that as a bug.

--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 
P

pinkfish.jm

Oh excellent! It works now.

Thanks!

in TextEdit, only in Excel.) Since the most you can ever save as CSV is only
one worksheet at a time, use 'save as' command rather than 'save workbook
as'. I tried it with the same sheet and it works perfectly. It opens in
TextEdit looking exactly the same as doing it in the UI.

Also, by 'filename' it actually means the full colon-delimited file path,
although it will save it to the folder where you last saved a document if
you use just the actual name as you did.

Try

save as active sheet filename "finish.csv" file format CSV
file format

I agree that it's a bug to allow the CSV file format (and probably several
other file formats such as the text formats) to operate with 'save workbook
as' and then have it not save properly. I'll file that as a bug.

--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 

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