Excel v.x
Excel v.x
- Subject: Excel v.x
- From: "Craig D. Sutherland" <email@hidden>
- Date: Thu, 29 Nov 2001 21:33:23 -0600
Received the MS Office upgrade and began to explore existing scripts
created in Script Debugger 3.0.1-- well actually trued to run a script
that called a MS Excel VB macro which had functioned just fine under
10.0.1, AS 1.7f2 and Excel 2001.
The script uses the Excel verb Evaluate to call the VB Macro. In Excel
v.x, the Evaluate verb is in the Excel Dictionary and has the same
syntax as it did in Excel 2001, but the results are very different.
Evaluate does not cause the VB macro to execute as I would expect or as
it did in 2001. Instead, it returns a result of "=", and does not
execute the instructions within the macro.
Tell application "Microsoft Excel"
activate
evaluate "'Test.xls'!TestMacro()"
end tell
VB
Sub TestMacro()
sheets("sheet2").select
end sub
Also tried "'Test.xls'!TestMacro" (no parens thinking the parens now
define a function).
Tried recording a script to duplicate the VB actions and the resulting
applescript produced the same, "=" result and did not execute the
function in the macro.
I looked at the RealBasic capabilities to see if Evaluate was not the
right way to call an OSA event, but did not see any hints. MS is clear
in the documentation provided for OSA that VBA code can be copied ot
RealBasic. They state that VBA code will run faster. No other
documentation can be found by the very surprised and frustrated scripter.
There has to be some basic Homerian "DOH!" that will once again provide
a dose of un-appreciated humility.
Ideas?
Craig Sutherland