Using the Visual SourceSafe Add-In with the Visual Basic Environment

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The new VBA Source Code Control add-in included with Microsoft Office 2000 Developer conveniently provides Visual SourceSafe functionality within the Office development environment.

Note   In order to use the VBA Source Code Control add-in, you must first load it into the Office environment. For information on loading the Office 2000 Developer add-ins, see Accessing Office 2000 Developer Tools.

How Source Code Control Works

While a group of Office developers work together to build a database application, the master copies of all the VBA objects are kept in a Visual SourceSafe project. Each developer works on a VBA project on their local workstation. Checking out source code objects from the Visual SourceSafe version control system copies them from the Visual SourceSafe project into the developer's project on the local workstation. Checking in source code objects copies them from the developer's local workstation into the Visual SourceSafe database.

For information about the types of items you can use with the VBA Source Code Control add-in, see Using Visual SourceSafe with Documents and VBA Code.

Visual SourceSafe provides useful versioning and control functionality. When you install the VBA Source Code Control add-in and place your project under source code control, the following commands are added to the VBA Source Code Control submenu on the Add-Ins menu.

  • Get Latest Version   This command overwrites your local version with the current object in the database. With the Get Latest Version command, some objects may appear in the list box that are not actually part of your database. These are objects that other users have put in Visual SourceSafe that you have not copied yet.

  • Check Out   This command copies the selected objects to the current project and updates the Project control status window to indicate the files are checked out to a specific team member. Checking out an object gives you the ability to make changes to that object. When you check out an object, no other developer can check out that object until you check it back in.

  • Check In   This command displays a dialog box that lets you select the objects to check in. You can optionally check the files in but also keep them checked out to continue working on them. You can include a comment describing the latest modifications made to the file. Checking in an object gives other developers the chance to view and use your changes to that object.

  • Undo Check Out   This command reverts to the last version saved in Visual SourceSafe.

    Note   When you select the Get Latest Version, Check Out, or Undo Check Out commands, the objects on your machine may be different versions than the objects in the Visual SourceSafe project. If so, the objects are synchronized as they are copied from the Visual SourceSafe database to your workstation, overwriting your versions of the objects.

  • Show History   This command displays a dialog box showing the history of the currently selected object.

  • Show Differences   This command compares the local copy of an object to the one in the Visual SourceSafe project and shows how they differ using a textual display.

  • SourceSafe Properties   This command displays Visual SourceSafe object properties (such as comments and check-out status).

  • Add Files to SourceSafe   This command displays a dialog box with a list of the objects that are currently in your project but are not under source code control. You use this dialog box to add these objects to Visual SourceSafe.

  • Get Object from SourceSafe   This command copies the object from Visual SourceSafe, drops it into your project on your workstation, and then gives you the option of putting it under source code control within your project. The copied object is essentially a new object that now belongs to your project and is no longer associated with the object's original source. The original object still remains in Visual SourceSafe.

    For More Information   This command is one of several ways to reuse existing code. For additional information on code reuse, see the topics Sharing and Reusing VBA Objects and Sharing and Reusing Source Code in this section.

  • ****Run SourceSafe ****  This command runs Visual SourceSafe Explorer. If Visual SourceSafe is already running, it is brought to the front of your screen.

  • Refresh File Status   This command refreshes the data in the source code control window.

These commands typically display a dialog box with a list box of all the objects in the Visual SourceSafe project that the command applies to. For instance, if you choose the Check In command, the list box is filled with all the objects that you currently have checked out. Select the items that apply for the chosen command, and then click OK. Depending on what you had selected before choosing the command, certain items in the list box may already be selected.