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 JAE 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
Joined
Mar 1, 2007
Messages
34
Location
DE
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

 
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

Back
Top