Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting input object from separate VBA module

Status
Not open for further replies.

DanielMadureira

Automotive
Joined
Apr 13, 2017
Messages
16
Location
CA
Hi everyone,

I have a bit of a VBA rookie question.

I am able to do long VBA programs, with single inputs, multiple inputs, loops, etc etc.

But I'd like to start cleaning up my code, and avoid doing multiple copy/paste everytime to get my code running.

So, question:

How to I call and use inputs from external macros?

For example, say I have a code that uses one axisSystem, and multiple surfaces.

How to I call an external module and use the axisSystem collected, and from another module use the collection of surfaces in a loop for example?

Thanks in advance!
 
Hi, i work in Visual Basic, all code is on one place.
For start you need to write some methods, i don't know do you use them.
From other side you can have one main array for ex. for axis systems, and you can use it in all of your macros.
So when you make selection it will be stored in that main array, and you can use it in every macro you want.
Ofc you can have more of those arrays for different stuff.

I have one huge Visual Basic macro app and i use this approach. I don't know structure of your code, so i don't know can you go like this.

It will be good option if you move to Visual Basic its relay cool and easy. (visual studio is free to use)

you can check this post for example
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top