Thread
:
Keyboard Macros
View Single Post
#
8
Posted to microsoft.public.excel.programming
Chip Pearson
external usenet poster
Posts: 7,247
Keyboard Macros
Jim,
VBScript doesn't support named arguments, but VBA does, regardless of the
host application (e.g., Excel, Word, etc).
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com
"Jim Carlock" wrote in message
...
"Chip Pearson" wrote:
Jim,
I've tried ActiveCell.LocalAddress(RowAbsolute) but these Excel
functions don't seem to operate in the fashion that C functions
operate in. The := stuff is really bugging me, big time. It almost
appears that they originally were thinking that RowAbsolute:=True
and ColumnAbsolute:=True could be placed anywhere in the
function parameter list in any order, but I doubt that's the case.
In fact, that is indeed the case. When you use Named Arguments, you can
put
them in any order you like. However, once you use one named argument in
a
function call, you must use named arguments for all subsequent
arguments.
For example, the following calls are syntactically correct,
r = f(1,2,3,4)
r = f(1, 2, c:=1, d:=4)
but
r =f(1,2,c:=1,4)
is not.
That explains a lot of the confusion I was going through. Thanks for
the explanation!
Would you know if all varieties of VBApp are like that? That is,
Access and PowerPoint? I know vbScript runs through a different
interpreter and is useful for networking, scheduling, email, user login
information, etc and most vbScript is CreateObject("object") and
then using the object.properties / methods.
Right now I'm referencing DAO through Excel to grab data and
put the information into a few Excel spreadsheets. Things are
working out very well, better than I could have ever imagined.
VBApp is a little slow, but I'm going to try setting AutoCalc off
as I've read in some of Ogrevies statements in this newsgroup.
;-) He reminds me of an ogre and thus I remember his name.
I promise not to refer to you as Frito-Lay. Maybe Ruffles, but
definitely not Frito-Lay. ;-)
You don't have to use Named Argument if you prefer the "C-style"
positional syntax, but named arguments make the code vastly more
readable. For example, which is more self-documenting?
r = f(0,,,,,,,,,,,,,,,,1)
or
r = f(arg1:=0,arg15:=1)
Things sure do look different when I get a grip on what's really
happening. Thanks much.
--
Jim Carlock
http://www.microcosmotalk.com
Feel free to post back to the newsgroup!
Reply With Quote
Chip Pearson
View Public Profile
Find all posts by Chip Pearson