Re: Excel page setup (was prevent user input question)
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