PDA

View Full Version : Solved: Sending arguments to macro in Personal.xls



Marcster
02-08-2006, 05:51 AM
RE: http://vbaexpress.com/forum/showthread.php?t=7008


How do you pass arguments to the macro?
I've tried:

Run ("PERSONAL.XLS!RemoveAllVBACode(wb)")
Run ("PERSONAL.XLS!RemoveAllVBACode wb")

None work.

Set wb = ActiveWorkbook

The modue name in PERSONAL.XLS is:
ModRemoveAllVBACode


Thanks,

Marcster.

TonyJollans
02-08-2006, 06:35 AM
Go for .. Run ("PERSONAL.XLS!RemoveAllVBACode",wb)(assuming wb is a variable)

XLGibbs
02-08-2006, 06:35 AM
Run ("PERSONAL.XLS!'RemoveAllVBACode wb'")

Encapsulate both macro name and variable in ' tick marks..

Since they are in personal.xls you can also try

Call RemoveAllVBACode wb

Marcster
02-08-2006, 07:15 AM
Sorted it:

Run "PERSONAL.XLS!RemoveAllVBACode", wb

Thanks,

Marcster.