InfoConnect for Unisys
Attachmate.Reflection.Emulation.IbmHosts Namespace / IIbmTerminal Interface / AddVBAReference Method
The fully qualified file name of the session document file that contains the macros you want to share. Network locations should be specified with UNC file paths.


In This Topic
    AddVBAReference Method (IIbmTerminal)
    In This Topic
    Adds a reference to a session file that contains macros you want to share with the current session to the VBA References settings. After you add the reference, the macros in that file are available to the current session. When you save your session, the macros are saved in your current session document file and updated each time you reopen your session.
    Syntax
    'Declaration
     
    
    Sub AddVBAReference( _
       ByVal sessionPath As String _
    ) 
    'Usage
     
    
    Dim instance As IIbmTerminal
    Dim sessionPath As String
     
    instance.AddVBAReference(sessionPath)
    void AddVBAReference( 
       string sessionPath
    )

    Parameters

    sessionPath
    The fully qualified file name of the session document file that contains the macros you want to share. Network locations should be specified with UNC file paths.
    Exceptions
    ExceptionDescription
    This exception is thrown when you add a reference to a session file that is not in a trusted location.
    This exception is thrown when you add a reference to a session file that is not the same session type as the current session.
    This exception is thrown if a sesson file does not exist, is not a valid file, or has an invalid file name. It is also thrown if a sesson file contains VBA projects that conflict with existing VBA projects or if security settings prevent adding VBA references.
    Remarks

    Before you add a reference to a session document file, make sure that the file is in a trusted location that is specified with a UNC file path (if using a network location). Session document files cannot be accessed unless they are in trusted locations.

    Make sure the projects in the files you reference have unique project names. Each project name in the VBA editor must be unique to avoid errors caused by naming conflicts.

    See Also