Macro with Parameters

Started by drewdb, August 22, 2008, 05:22:03 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

drewdb

Does anyone know if there is a way to parse parameters to a macro.

I have a macro that creates a shape with a variable amount of inputs and outputs and i'd like the user to be able to enter the amount of ins and outs they require.

Do i need to create a form?

Paul Herber

Parameters can be passed to any subroutine (or macro), in VBA help lookup 'sub' and then look at the arglist section.

But if you want to ask the user then look at the InputBox function.

Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

drewdb

Thanks for the InputBox function. Not mentioned in my help files but i've got it working.

Thanks again.

Paul Herber

There is another way, have required values obtained from custom properties, set the custom property Ask to true, so when the shape is dropped on the page it'll automagically ask for the value.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

drewdb

I like the idea. I'm trying to get my template to be as intuitive as possible. I'm having problems getting the macro to run from the master shape only. It does run from the template but i'll keep trying.

I'll also add your suggestion.

Thanks