Microsoft Knowledge Base |
|
MXL5: Range Method Fails Calling Macro from AppleScript |
|
|
Last reviewed: June 13, 1997
Article ID: Q137903 |
|
The information in this article applies to:
SYMPTOMSWhen you attempt to run a Microsoft Excel macro from an AppleScript script, you may receive the following error message in AppleScript:
Execution Error Microsoft Excel got an error: AppleEvent timed out.In addition, when you activate Microsoft Excel, you may see an error message similar to the following:
Macro Error Run-time error '1004' Range method of Application class failed CAUSEYou may receive either or both of the error messages described above if your Microsoft Excel macro uses the Range method.
WORKAROUNDTo avoid this problem, eliminate all references to the Range method from the macro before you call that macro from AppleScript. One alternative to the Range method is the Cells method. For example, instead of using
Range("A1").Select
you could use:
Cells(1,1).Select MORE INFORMATIONThe Range method is a method of the Application class that allows a macro programmer to refer to a specific range of cells on a worksheet. This method works well in a Visual Basic for applications macro when it's called in Microsoft Excel. However, if the macro is called from AppleScript, the Range method may fail. For additional information, please see the following article(s) in the Microsoft Knowledge Base:
ARTICLE-ID: Q126045 TITLE : MXL5: Range Method May Fail When Used in Auto_Open Macro ARTICLE-ID: Q132437 TITLE : Calling Excel Macros and Functions from AppleScript |
|
Additional query words: 5.00 Apple Script
©1997 Microsoft Corporation. All rights reserved. Legal Notices. |