• 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 2008 - 'Autofit' broken?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Excel 2008 - 'Autofit' broken? (From: Barry Wainwright <email@hidden>)

  • Prev by Date: Is this list still active?
  • Next by Date: Re: Excel 2008 - 'Autofit' broken?
  • Previous by thread: Excel 2008 - 'Autofit' broken?
  • Next by thread: Re: Excel 2008 - 'Autofit' broken?
  • Index(es):
    • Date
    • Thread