Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

some Basic VB questions

Status
Not open for further replies.

tazengr

Mechanical
Mar 1, 2007
34
I am going through a tutorial in Mike Spens "Automating Solidworks 2006 using Macros" book in Chapter 4.

1. what is the point of changing
Dim swApp As Object
to
Public swApp As SldWorks.SldWorks

 
Replies continue below

Recommended for you

Changing "Object" to "Sldworks.Sldworks" is called "early binding". Basically, it means that you're telling the program what type of object swApp is going to be. It helps a bit with resources, and it also gives you the pop-up list of what methods, properties, etc are available for that type of object when you type the "." after the variable name. Using the Public changes the scope of the variable. Check VBA help for variable scope to get more information on this one. It does a better job of explaining than I could.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor