• 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: Making & Saving Excel documents
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making & Saving Excel documents


  • Subject: Re: Making & Saving Excel documents
  • From: "Duane L. Mitchell" <email@hidden>
  • Date: Sun, 22 Jul 2001 11:56:33 -0400

Recording is helpful when scripting Excel. I couldn't find sample scripts
anywhere and the dictionary is so large that you almost don't know where to
begin. I think it is the largest dictionary of any application.

Here's a little sample:

tell application "Microsoft Excel"
Activate
Create New Workbook --to create a new Excel document
Create New Worksheet --to create a new worksheet in the document
Select Range "A1" --to select a cell using the familiar reference
Select Range "R1C1" --to select a cell using the R1C1 format
set NumberFormat of Selection to "@" --formatting a cell as text, very
intuitive

--a routine to build a spreadsheet one row of data at a time

set vExcelRowCounter to 2 --initialize a row counting variable to the
beginning row
set vSelectRange to "R" & vExcelRowCounter & "C1" --build the Excel
reference
Select Range vSelectRange --select the starting cell for that row
Select (Offset ActiveCell ColumnOffset 1) --move across the row one cell
Set vExcelRowCounter to vExcelRowCounter + 1 --increment the row counter
end tell

Have fun,

Duane


  • Prev by Date: Re: Incrementing digits in a file name (was: writing multiple files)
  • Next by Date: Re: conditional error
  • Previous by thread: Making & Saving Excel documents
  • Next by thread: re: TCP/IP control panel be scripted?
  • Index(es):
    • Date
    • Thread