Skip to content

5 Deploying for Production

Mandla edited this page Sep 25, 2017 · 2 revisions

Rename File Copy

The first stage of production deployment (assuming the working file has had all necessary functional updates made) is to create a copy of the file, and rename it. The naming convention in use as of the writing of this documentation is as follows:

Working File: freeform_templates_tool_working.xlsm

Production File: freeform_templates_V[version number].xlsm

It is also advised to keep a backup working file that is updated whenever a new version is released, so that the working file can always be reverted to the most recent production state.

Setup Exit on Close

The second stage of preparing the file for production is to change the code in the ufrmMain form to make sure that when the pop up form is closed, the entire application terminates as well.

The working file keeps the application running when the pop up is closed, allowing the developer to subsequently access the code and make alterations. This is inappropriate for a tool in production, and the following changes in the UserForm_Terminate() function prevent this from occurring:

Private Sub UserForm_Terminate()
   ' Delete this line
    Windows(ThisWorkbook.Name).Visible = True

   ' Add this line
    Application.Quit
End Sub

Note: Once this change has been made and the file has been saved and closed, you will no longer be able to access the code to make further edits. As such, it is extremely important to make sure to rename a copy of the file before doing so, and ensuring that no further changes need to be made before the file is ready to be put to use.

Clone this wiki locally