Re: Excel 2008 - 'Autofit' broken?
Re: Excel 2008 - 'Autofit' broken?
- Subject: Re: Excel 2008 - 'Autofit' broken?
- From: Matthew Smith <email@hidden>
- Date: Tue, 06 Jan 2009 19:55:29 +1100
- Thread-topic: Excel 2008 - 'Autofit' broken?
on 04/01/2009 04:47 , Barry Wainwright at email@hidden wrote:
> The following syntax used to work in Excel 2004, but is now broken in
> 2008:
>
> tell application "Microsoft Excel"
> set wb to make new workbook
> set dataRange to range "A1:C4"
> set value of dataRange to {{"one", "two", "three"}, {"one", "two",
> "three"}, {"one", "two", "three"}, {"one", "two", "three"}}
> autofit dataRange
> end tell
>
>
> In 2008 it produces the error "Microsoft Excel got an error: range
> "A1:C4" doesn¹t understand the autofit message."
>
> can anyone else confirm or offer a work-round?
This works:
tell application "Microsoft Excel"
set wb to make new workbook
set dataRange to range "A1:C4"
set value of dataRange to {{"one", "two", "three"}, {"one", "two",
"three"}, {"one", "two", "three"}, {"one", "two", "three"}}
autofit column "A:C"
end tell
I think it needs to be a column range or row range but not just a range of
cells.
--
Matthew Smith
_______________________________________________
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