Adds an existing file with user macros.

Syntax:

AddUserMacros( FileName As String, Name As String ) As Boolean
Return: Boolean
Parameters: FileName File name of the user macros file to be added. An error occurs if the file with the given name does not exist.
Name Name of the user macros file shown in the VBA Editor. If the "Name" parameter is an empty string, the name saved in the file is used.

Example:
Dim Tool As VBATool
Dim Filename As String

Set Tool = Application.Tools.VBATool
Filename = Application.Tools.DirectoryTool.GetDefaultMacroPath & "NewMacros.macro"
Call Tool.AddUserMacros(Filename, "")

See also:

Class VBATool


Last Updated: 04/27/05