×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

some Basic VB questions

some Basic VB questions

some Basic VB questions

(OP)
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

RE: some Basic VB questions

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources