Show Contents / Index / Search

Import and Export Visual Basic Files

An additional option for sharing Visual Basic code is to export code module (.bas), class (.cls), and form (.frm) files. Reflection 2008 users can import these files directly to a Reflection 2008 project in Visual Basic to add new functionality to session documents without altering existing macros.

Note: You cannot use macro files to run macros that use forms or that call other subroutines, in your Visual Basic Project. For example, any recorded macro will run successfully after it has been exported to a macro file, because all the code in any recorded macro file is contained within a single subroutine. However, let's say you have two macros: a recorded macro (MacroA), and a second macro (MacroB) which includes a call to MacroA. MacroB would not run correctly after being exported to a macro file, because the code in MacroA is not included in its exported file.

To import Visual Basic files

  1. From Visual Basic Editor, select a project (session document) in the Project Explorer to which you want to import the Visual Basic file, and then choose File > Import File.
  2. Select the file, and then click Open.

    The file appears in the project folder that matches the file type.

To export Visual Basic files

  1. From Visual Basic Editor, in the Project Explorer, select the module, class, or form that you want to export, and then choose File > Export File.
  2. Select a location, and then click Save.