How to remove the password prompt from recorded VBA macros

  • 7024220
  • 29-Oct-2019
  • 31-Oct-2019

Environment

Reflection Desktop (including Pro, for X, for IBM, or for UNIX and OpenVMS) 16.0 or higher

Situation

This technical article describes how to remove the password prompt from a recorded VBA macro.  When a VBA macro is recorded in Reflection Desktop, a password prompt dialog is automatically added to the macro in place of actually recording the password.  There may be circumstances where having a password embedded in a macro is desirable, although this is a security risk.  Undertake this process with extreme caution and after careful deliberations of the potential for the password being compromised by others who should not have the information.

Resolution

Manually edit the VBA macro in the VBA Editor:

1. Open the VBA Editor and find the recorded macro which needs modification.

2. Identify the following line:
        hiddenTextEntry = ibmCurrentTerminal.Macro.PasswordBox("", "")

3. Comment out this line by adding an apostrophe at the beginning of the line as shown below:
        ' hiddenTextEntry = ibmCurrentTerminal.Macro.PasswordBox("", "")

4. Add a new line in the macro at the same location:
        hiddenTextEntry = "password"
             - where the word password is the actual password needed.