Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-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
Apr 13, 2017
16
0
0
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!
 
Replies continue below

Recommended for you

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.
Back
Top