• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Excel page setup (was prevent user input question)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Excel page setup (was prevent user input question)


  • Subject: Re: Excel page setup (was prevent user input question)
  • From: Stan Cleveland <email@hidden>
  • Date: Tue, 06 Nov 2007 14:56:44 -0800
  • Thread-topic: Excel page setup (was prevent user input question)

On 11/6/07 12:10 PM, Oakley Masten wrote:

> Let's try this one again.  Appears to have gotten lost
> in the shuffle.
>
> I would really rather use Excel AppleScripting but was
> unable to find any way to get Excel to set "Fit to
> Page" for printing.
>
> Is there a way to do it and if so what is it.


tell application "Microsoft Excel"
    tell page setup object of worksheet "Sheet1"
        set fit to pages tall to 2
        set fit to pages wide to 1
        set page orientation to portrait
        return properties -- to see all page setup options
    end tell
end tell


> Also I could not get it to set "Letter" as page size.
> I could not find that one either.
> Can it do that and if so How?


Oddly, page size is not accessible via the worksheet's page setup object. As
far as I know, there is no direct access to page size in the Excel
dictionary. The closest thing I could find is to "show" the page setup
dialog, from which a user could click the "Options..." button and manually
set the page size from there:
    tell application "Microsoft Excel"
        show (get dialog dialog page setup)
    end tell

Perhaps this could be accessed via GUI scripting, but I don't know that
answer. Seems to me to be a major failing in Excel's scripting capability.

Stan C.


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >prevent user input question (From: Oakley Masten <email@hidden>)

  • Prev by Date: Re: Print-to-PDF
  • Next by Date: Scripting Pages 3.0 Page Layout documents
  • Previous by thread: prevent user input question
  • Next by thread: embedded osaxen
  • Index(es):
    • Date
    • Thread