Personal.XLS Prob.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a family of macros and functions associated with a WB. I have now
created a subset of the WB's data into a new WB. The main processing macro is
large, and makes calls to a number of macros and functions.

I copied the Modules for all the associated macros and functions from their
original location to my Personal.XLS WB using Export and Import. Everything
is visible when I am in the VBA IDE, but when I make a call such as this:

Call Initializing.InitCodes(intK, blnCodes(), strSalaryOrHour, intWksCount,
strQualErnCd, intQualPeriod)

I get "Object required 424". Also when I do Alt-F8 the macros and functions
of the Modules in Personal.XLS do not appear to be listed (at least this one
isn't). After surfing around here I thought I had found my "AHA" moment when
one of the replies told a person who had queried with something similar, to
exit Excel and restart. Didn't work for me.

I'm willing to bet it's something truly trivial I am missing -- just can't
seem to think what it might be <g>!
 
Any function or sub that contains argument will not apper in Alt+F8 since

typing something like

Mymacro "AA",6,"bb"

would seem counter intuitive. It actually works, but mymacro is not listed
- you have to know to do it.

You can't call a macro from another workbook in code unless you create a
reference to that workbook (which is usually undesirable). You have to use
application.Run

Application.Run "Personal.xls!Initializing.InitCodes, _
intK, blnCodes(), strSalaryOrHour, intWksCount, _
strQualErnCd, intQualPeriod

This assumes that Initializing is the name of your module.

Note that the arguments are listed as a comma separated list along with the
macro name, not in the same format as using call. See the help on
Application.run for details.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top