![]() |
|
Do you know where your variables are? | |
PerlMonks |
Re: Perl vith VBA macros with argumentsby pryrt (Abbot) |
on Oct 11, 2022 at 20:59 UTC ( #11147359=note: print w/replies, xml ) | Need Help?? |
I created a macro-enabled spreadsheet which had the following VBA:
Cell A1: =myfn(RANDBETWEEN(5,17)) -- this cell-formula proves that myfn(arg) is working: Excel generates a random integer from 5 to 17, and passes it to myfn ; the myfn VBA then adds a random offset Then I run the following perl, using Win32::OLE :
The output I get will be some random number from 17 to 18:
This is using the 'Run' Application Object from the Excel Object Model. The function (or subroutine) name is the first argument to $Excel->Run() ; arguments to that function/subroutine are the remaining arguments.
In Section
Seekers of Perl Wisdom
|
|