MXL: Using AppleScript with Microsoft Excel

Last reviewed: February 2, 1998
Article ID: Q113891
The information in this article applies to:
  • Microsoft Excel for the Macintosh, versions 4.0, 4.0a, 5.0, 5.0a
  • Microsoft Excel 98 Macintosh Edition

SUMMARY

Microsoft Excel versions 4.0 and later support AppleScript in the scriptable capacity. This allows Microsoft Excel to be controlled from other programs or scripts.

MORE INFORMATION

Apple Computer, Inc., has defined an English-like batch file processing system for the Macintosh line of personal computers. This system is similar in power and flexibility to UNIX shell scripting, but is much easier to use.

Microsoft Excel versions 4.0 and later supply the "aete" resource and the necessary Apple Event capability to fulfill the scriptable level of AppleScript support. To use the application-specific capabilities of Microsoft Excel with AppleScript, open and examine the AppleScript dictionary supplied with Microsoft Excel.

To open the dictionary in Microsoft Excel by using the Script Editor, follow these steps:

  1. Start the Script Editor.

  2. On the File Menu, click Open Dictionary.

  3. In the dialog box that appears, open the folder that contains the Microsoft Excel program.

  4. Select the Microsoft Excel program and click Open.

The window that appears allows you to select an object or a class to view its description. You can also click the bold suite names to view an entire suite at one time. The descriptions in this window can be used to create scripts within the Script Editor to control Microsoft Excel.

The following is a list of Apple Events supported by Microsoft Excel for the Macintosh.

Microsoft Excel Version 5.0 and Microsoft Excel 98 Macintosh Edition

These versions of Microsoft Excel support a very large number of events. For a complete listing, follow the instructions in this article to open Microsoft Excel in the AppleScript Script Editor.

Microsoft Excel Version 4.0

Core suite:

   Clone              Do Objects Exist   Print
   Close              GetData            Quit
   Count Elements     Get Data Size      Save
   Create Element     Move               SetData
   Delete             Open

Miscellaneous Standards suite:
   Begin Transaction  Do Script          Redo
   Copy               End Transaction    Revert
   Create Publisher   Paste              Undo
   Cut

Table suite:
   The table suite does not define any Apple Events, but it defines
   some objects. Microsoft Excel supports and extends the definition
   of these objects.

Custom Apple Events:
   DoMacro
   Recalc

Microsoft Excel Version 3.0

   Open Application
   Open Documents
   Print Documents
   Quit Application

REFERENCES

"Inside Macintosh Inter-application Communication", Chapters 4, 7-10 "AppleScript Software Developers Kit" "Microsoft Excel SDK", version 4.0, pages 148-149


Additional query words: 4.00 4.00a 5.00 5.00a 98 programming Apple script
code
Keywords : kb3rdparty kbenv
Version : MACINTOSH:4.0,4.0a,5.0,5.0a,98
Platform : MACINTOSH
Issue type : kbinfo


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 2, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.