Microsoft Office Tutorials and References
In Depth Information
Executing Sub Procedures
When you open a workbook that contains a reference to another workbook, the referenced
workbook is opened automatically.
the workbook names that appear in the list of references are listed by their VBE project
names. By default, every project is initially named VBAProject. Therefore, the list may
contain several identically named items. To distinguish a project, change its name in
the Project Properties dialog box. Click the project name in the Project window and
then choose Tools➜ xxxx Properties (where xxxx is the current project name). In the
Project Properties dialog box, click the General tab and change the name displayed in
the Project Name field.
The list of references displayed in the References dialog box also includes object libraries and
ActiveX controls that are registered on your system. Your Excel workbooks always include
references to the following object libraries:
h Visual Basic for Applications
h Microsoft Excel 14.0 Object Library
h OLE Automation
h Microsoft Office 14.0 Object Library
h Microsoft Forms 2.0 Object Library (this reference is included only if your project includes
a UserForm)
Any additional references to other workbooks that you add are also listed in your
project outline in the Project Explorer window in the VBE. These references are listed under
a node called References.
If you’ve established a reference to a workbook that contains the procedure MySub , for example,
you can use either of the following statements to call MySub :
YourSub
Call YourSub
To precisely identify a procedure in a different workbook, specify the project name, module
name, and procedure name by using the following syntax:
MyProject.MyModule.MySub
Alternatively, you can use the Call keyword:
Call MyProject.MyModule.MySub
 
Search JabSto ::




Custom Search