• 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: Scripting Excel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting Excel


  • Subject: Re: Scripting Excel
  • From: Paul Berkowitz <email@hidden>
  • Date: Sat, 19 Feb 2005 08:11:42 -0800

Title: Re: Scripting Excel
On 2/19/05 7:22 AM, "Brian" <email@hidden> wrote:

Hello, excel can be 'recorded', so you can use the 'Record' button of the Script Editor and then go do something in excel to see what command you can use in your script. Or just open the excel dictionary, in the Script Editor to.

Alert: Excel 2004 cannot be recorded, and the AppleScript implementation has been completely rewritten.  So none of this will work if Gonçalo has 2004.  (Also, that "L5C1" range address was correct only in French Excel X, it would have been different in other languages, including perhaps Portuguese, which I don't know. In English-language Excel that was "R5C1".)

For inserting lines :  

tell application "Microsoft Excel"
    Activate
    Select Range "L5C1" -- Mean Line/Row 5 - Column 1 = cell A5
    repeat 5 times
        Insert EntireRow of Selection
    end repeat
    
-- Will insert 5 lines before cell A5
end tell

In 2004 that would be:

tell application "Microsoft Excel"
    activate
   select cell "A5" of active sheet
   repeat 5 times
       insert into range (entire row of selection)
    end repeat
end
tell


But it's much better not to do any selecting. Assuming you again want to insert new lines above row 5:

tell application "Microsoft Excel"
    repeat 5 times
       insert into range (range "5:5" of active sheet)
    end repeat
end
tell



--
Paul Berkowitz
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Scripting Excel (From: Brian <email@hidden>)

  • Prev by Date: Re: Microsoft Excel
  • Next by Date: Re: OT: Terminal ps grep window size issue?
  • Previous by thread: Re: Scripting Excel
  • Next by thread: Re: Microsoft Excel
  • Index(es):
    • Date
    • Thread