• 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: Need Excel AppleScript for Office 2004 for Macintosh
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need Excel AppleScript for Office 2004 for Macintosh


  • Subject: Re: Need Excel AppleScript for Office 2004 for Macintosh
  • From: Stan Cleveland <email@hidden>
  • Date: Mon, 01 Oct 2007 18:35:56 -0700
  • Thread-topic: Need Excel AppleScript for Office 2004 for Macintosh

On 10/1/07 5:22 PM, deivy petrescu wrote:

> Raymond ;
> I have office X so I can not tell you the whole story.
> Stan gave you a good start. However it might take a while for it to run.


Elapsed time for 300 rows, columns A-AZ, took 7.3 seconds on my ancient
PowerBook. If that's not fast enough, there are well-documented ways to
dramatically speed up list operations in AppleScript.


> In office X, I can not test this new approach because it apparently
> does not work (a bug), but it might in office 2004.
> There is an option with PasteSpecial that is SkippingBlnks.
> You can copy a whole table and then paste skipping blanks.
> That reduces your loop from a bunch to 1.
> Try it with 2004, or Stan might be able to do it.


First of all, copy/paste in AppleScripting usually works, but I avoid it
just because there are some situations where it can fail. Most importantly,
the application MUST be frontmost during those operations.

I checked the Excel 2004 dictionary and attempted the copy/paste special
trick. The code I tried is below. It compiles and runs without error, but
doesn't remove blank cells as expected. It just seems to copy, then paste
the range unchanged. Perhaps another Excel scripter has an idea on how to
get it working.

Stan C.


tell application "Microsoft Excel"
    set cut copy mode to copy mode
    activate
    cut range range "A1:AZ300"
    paste special range "A1:AZ300" what paste all with skip blanks
end tell


 _______________________________________________
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

  • Follow-Ups:
    • Re: Need Excel AppleScript for Office 2004 for Macintosh
      • From: Stan Cleveland <email@hidden>
References: 
 >Re: Need Excel AppleScript for Office 2004 for Macintosh (From: deivy petrescu <email@hidden>)

  • Prev by Date: Re: Need Excel AppleScript for Office 2004 for Macintosh
  • Next by Date: Re: Need Excel AppleScript for Office 2004 for Macintosh
  • Previous by thread: Re: Need Excel AppleScript for Office 2004 for Macintosh
  • Next by thread: Re: Need Excel AppleScript for Office 2004 for Macintosh
  • Index(es):
    • Date
    • Thread