Skip to main content

File menu


Command Description
Close & Return to <host application> Closes the development environment and returns you to the host application. Visual Basic is hidden but remains in memory.
Close Project Closes the current project. If the project contains any unsaved changes, you are prompted to save the project before closing.

Import File, Export File

Adds existing modules and forms to your project, or saves a module or form as a separate file.

Command Description Toolbar button Keyboard shortcut
Import File Displays the Import File dialog box, which allows you to add an existing module or form to the project. A copy of the file is added to the project, and the original file is left intact. If you import a form or module with the same name as an existing one, the file is added with a number appended to it.

Imported components appear in the Project Explorer window.

Export File Displays the Export File dialog box so that you can extract the active form or module from the project. The file is copied into an external file.

Not available if you have not selected a file in the Project Explorer.



Command Description Toolbar button Keyboard shortcut
Print Prints forms and code to the printer specified in the Microsoft Windows Control Panel. See also the Print, Print Setup dialog boxes. CTRL+P

Remove Item

Command Description
Remove <Item> Permanently deletes the active form or module from the project. Not available when an item is not selected in the Project Explorer.

When removing a module from a project, make sure the remaining code doesn't refer to the removed item.

Before your item is deleted, you are asked if you want to export it as a file. If you click Yes in the message box, the Export File dialog box opens. If you click No, the item is deleted.

IMPORTANT: You cannot undo this action.

Save Host Document

Command Description Toolbar button Keyboard shortcut
Save <host document> Saves the current project and all of its components (forms and modules) with your document. A standalone project is saved separately as a project file with a .vba extension.

The Save command displays the Save As dialog box if this is the first time the project is being saved.


Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>