[Pythonmac-SIG] Pythonmac-SIG Digest, Vol 95, Issue 20

Christian Prinoth christian at prinoth.name
Fri Mar 18 14:58:33 CET 2011


maybe you need to use the constant instead of "CSV", i.e. k.CSV_file_format


On Fri, Mar 18, 2011 at 12:00, <pythonmac-sig-request at python.org> wrote:

> Send Pythonmac-SIG mailing list submissions to
>        pythonmac-sig at python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        http://mail.python.org/mailman/listinfo/pythonmac-sig
> or, via email, send a message with subject or body 'help' to
>        pythonmac-sig-request at python.org
>
> You can reach the person managing the list at
>        pythonmac-sig-owner at python.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Pythonmac-SIG digest..."
>
> Today's Topics:
>
>   1. Appscript and Excel save_as (Dan Ross)
>
>
> ---------- Forwarded message ----------
> From: Dan Ross <dan at rosspixelworks.com>
> To: Pythonmac sig <pythonmac-sig at python.org>
> Date: Thu, 17 Mar 2011 13:57:19 -0500
> Subject: [Pythonmac-SIG] Appscript and Excel save_as
>
> Hi there-
>
> I have the following AppleScript:
>
> set theOutputPath to (path to desktop folder as string) & "My Saved
> Workbook.csv"
> tell application "Microsoft Excel"
>     tell active workbook
>         save workbook as filename theOutputPath file format CSV file format
>     end tell
> end tell
>
> This works fine. When I try to use appscript I cannot get the stinking
> spreadsheet to save as a CSV file with the following:
>
>
>
> from appscript import *
>
> excel = app('/Applications/Microsoft Office 2008/Microsoft Excel')
> excel.open('/Users/danr/Desktop/Test.xlsx')
> name = excel.worksheets[1].name.get()
> print(name)
> excel.worksheets[1].save_as(filename = 'boogers.csv', file_format = "CSV")
>
>
>
> Any pointers?
>
>
>
> Thanks,
>
>
>
> Dan
>
> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20110318/1aa141b9/attachment.html>


More information about the Pythonmac-SIG mailing list