infrequentcoder
New Member
- Joined
- Sep 12, 2022
- Messages
- 14
- Office Version
- 2021
- 2019
- 2016
- Platform
- Windows
Finally, there is an updated and legitimate way to require macros, which I will share with you here and stumbled upon via trial of various methods. The common methods found online, such as toggling worksheets visibility, are flawed at best.
INTRODUCING, the very simple yet effective "smokescreen" technique.
This process involves two major actions:
- Secondary workbook
- VBA code obfuscation/invisibility
1. The first step is to encrypt the workbook for which you want to require macros with an "open" password between 1 and 255 characters.
2. Next, you will create a totally SEPARATE workbook. This workbook effectively serves as your "smokescreen".
3. You will add an icon/shape/image within this workbook on any sheet that is assigned to an internal macro. The purpose of this macro is to launch the primary workbook. This assigned macro can not be triggered without Trust Center macros enabled.
4. Create the macro which opens the primary workbook and inputs the special password. You may have to error check for handling whether the Trust Center also has access the VBA project object model as a condition prior to launching primary workbook. This will depend on your subsequent code requirements.
5. Assign authenticating macro to object on worksheet
6. Obfuscate/prevent visibility of the secondary workbook VBA code to conceal the necessary password for opening the primary workbook. This step is being prematurely revealed. There are a few solutions available online, which are still being tested by myself. They involve going into the .bin file of the VBA project itself. I will hopefully post a final solution for the community once all is debugged.
INTRODUCING, the very simple yet effective "smokescreen" technique.
This process involves two major actions:
- Secondary workbook
- VBA code obfuscation/invisibility
1. The first step is to encrypt the workbook for which you want to require macros with an "open" password between 1 and 255 characters.
2. Next, you will create a totally SEPARATE workbook. This workbook effectively serves as your "smokescreen".
3. You will add an icon/shape/image within this workbook on any sheet that is assigned to an internal macro. The purpose of this macro is to launch the primary workbook. This assigned macro can not be triggered without Trust Center macros enabled.
4. Create the macro which opens the primary workbook and inputs the special password. You may have to error check for handling whether the Trust Center also has access the VBA project object model as a condition prior to launching primary workbook. This will depend on your subsequent code requirements.
5. Assign authenticating macro to object on worksheet
6. Obfuscate/prevent visibility of the secondary workbook VBA code to conceal the necessary password for opening the primary workbook. This step is being prematurely revealed. There are a few solutions available online, which are still being tested by myself. They involve going into the .bin file of the VBA project itself. I will hopefully post a final solution for the community once all is debugged.