The question
What is an effective work-around to prevent a Digital Signature dropping from a file when it's saved? Or, What would be an efficient way to replicate saving data to a Macro Enabled MS Word Document with a Digital Signature?
Some context...
Long story short, my workplace now require Macro enabled files to be signed with a Digital Signature otherwise Macros are disabled (with no enable option) due to a security policy update. My concern is specifically with MS Office Applications using VBA.
Note: I have no say in the matter nor do I have the ability to discuss this with the team that implemented the change.
Also Note: I unfortunately don't know what type of Signature will be applied to my document or where it will be from.
With that said, I am not very familiar with Digital Signatures however to my understanding once a file has been signed with one, if you save the file update any code in the project it will lose the Digital Signature.
I had just about finished developing a MS Word Document containing a fair bit of VBA and UserForms when the policy was changed and here lies my potential problem.
For clarity
The MS Word document is an Assessment used throughout various training for the business to ensure staff have a sound understanding of newly learned work types.
There are 3 stages that the document is saved at:
- Assessment Creation
- Participant Completion
- Assessor Marking
Step 1 involves a UserForm that when completed writes the user input values to various bookmarks (both placeholder and enclosing) pre-set on the blank document. The Document is then programmatically saved and re-named from "Assessment Template" to "[Skill Type] Assessment [Assessment Number]" (with the '[]' variables assigned per user inputs).
Step 2 involves a UserForm that requests some basic user data (name, location, team number etc) and displays the contents of enclosed bookmarks from the document in some UserForm labels as questions, with TexBox sections to provide an answer. This is then submitted programmatically via email attachment which involves the document being saved and re-named to add "_[Participants Name]" to the end of the file name.
Step 3 involves a facilitator marking the assessment with aid of yet another UserForm and then submitting the results to the participants team leader via email (again using VBA). Here the document is saved as macro free as it's only sent as reference of the result.
In summary
So based on my understanding that once the document is saved VBE project has any updates the Digital Signature will no-longer be valid and my project is no-longer useful in our current work environment.
I'm trying to better my understanding of how the digital Signatures work (if different to my current understanding) and I'm trying to work out some alternate solutions to the document being saved and subsequently losing the Signature if required.
As an example of what I'm attempting, a colleague has replaced saving an excel form with writing the user inputs to a .bin file saved to the users documents (only 5 short inputs). As this form is never saved (in fact saving the document is disabled) this was a suitable method for replacing the SaveAs prompt and keeping the WorkBook as Macro Enabled.
Note: I don't believe this is a suitable solution to follow for my document due the the amount of data that would be input to my document (not to mention the above would only show results for the user that made the changes and nobody else).
Update
It seems to be the file that was tested has a function that writes to the VBE (along with the worksheet is a big part of the project) so this may be what's caused the confusion I have with changes made causing the signature to drop.
As I now understand a bit more about the Signatures (I may have simply asked here too soon) and the actual situation regarding other files in the environment, I'm thinking if the Document is Digitally Signed and no changes are made in the VBE thereafter, the document can be saved with changes made to the document contents and this will not impact the validity of the Signature?
9 Reset to default