Re: Scripting Excel 2004 macros
Re: Scripting Excel 2004 macros
- Subject: Re: Scripting Excel 2004 macros
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 03 Feb 2005 01:32:54 -0800
On 2/2/05 6:14 PM, "Larry McMunn" <email@hidden> wrote:
> I need to call several Excel Macros at different times in a script.
> if we use what we think is the correct syntax, the macro runs two
> times.
> Example:
> tell application "Excel_2004"
> activate
> run VB macro "ExLio_Macros_E.xls!TestMacroToo()" --runs twice
> --run VB macro "ExLio_Macros_E.xls!TestMacroToo" --only runs once
> end tell
>
> The test Macro simply beeps and then displays a message window with
> the string "This message is from the macro within Excel."
>
> I was under the impression that the call for the macro needed the
> complete name including to the workbook containing it as well as the
> complete Macro name including the parens on the end. This has me
> wondering why the version without the closing parens works and runs
> once, but the version with the complete name runs twice. Any ideas or
> suggestions out there?
I don't know why the () version calls the macro twice, but the Excel 2004
AppleScript Reference (available from
<http://www.microsoft.com/mac/resources/resources.aspx?pid=asforoffice>)
does not include the parentheses in the example given on p. 233:
set mySum to run VB Macro "MYCUSTOM.XLM!My_Func_Sum" arg1 1 arg2 5
So your impression is not correct, at least for Excel 2004.
--
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