Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Digital signature not recognized after workbook is saved

Status
Not open for further replies.

JazzyLee

Programmer
Jan 24, 2002
47
US
I signed my workbook with a digital signature using SELFCERT and it has worked fine for the last ten months. I am suddenly having problems with reopening the workbook after using it and saving it and can't figure out why. I did make changes to it; added a userform, macros to run each time a cell is changed, and macros on the BeforeClose and BeforeSave events. Could any of this be the reason I am getting the following error:

The macros in this file do not match the digital signature. Only a macro virus would cause this. Please scan for viruses, and notify the publisher of this document. Macros will be disabled.

I need to be able to have employees in my company use this workbook without having problems since it is rendered useless if the macros are disabled and cannot run when opened. HELP!!!
 
If users on other machines are making saves to this file the cert will be rendered useless.

maybe instead of saving the data in that particular workbook, have vba mirror that data to another.

 
Users are not actually saving to the file. I put a copy on our company intranet for them to use or email them a copy of the workbook and then they save to their own machine. It seems to work fine when you first open it. It brings up the screen the first time to enable the macro and click on the trusted source box. Once they use it and save it to their machine, when trying to reopen it, the message appears and the macros are disabled.
 
Does the message appear in the copy or the original?
 
It only happens when reopening the saved copy. I can close down the bad version and open the original and it opens fine ... with macros enabled ... so I know the signature is still validating. Just cannot figure out why it doesn't recognize it after I save it.
 
Thats what I thought...you may have to extract the data to an external local file for the purpose of saving the data, using the cerified workbook as an evironment to manage the data, loading from a text file maybe upon open and sving to the same text file on close. this adds a degree of complexity but depending on you data layout maybe not.

Another option would be a two way link between access and excel storing the data in access and working in it in excel via an odbc / mdac link.
 
ETID,
I might have figured out why I had this problem with the mismatched digital signature. In trying to complete the work on my workbook and doing so from home on my personal machine, I got a message that said I have modified a signed project and do not have the right key to sign the project so the signature will be discarded. Being a little smarter than I was a week ago, I went looking and saw that the VBA project certificate name was replaced with [No Certificate] yet it still had the certificate name in the 'Sign as' area. This problem did start when I worked from home last Tuesday and forwarded sample copies of my workbook via email to a few users to test. Am I right in assuming that as long as I re-sign and save this workbook on the same machine at work when making modifications, my users should not have a problem with the macros being disabled due to the missing signature? Hope I am on the right track. It's almost time to deploy this workbook over our company's Intranet and sure don't want users getting frustrated with it being unusable ... being it's driven by macros.
 
Jazzy,

You are correct, anytime you make changes to a signed excel document, you have to re-sign the document or the signature will be discarded. This is to prevent anyone from altering a file that is digitally signed and using the original digital signaure as authentication (such as someone inserting a virus macro into a signed workbook and attempting to distribute it as a trusted signed document). As long as you re-sign the workbook after you finish making changes to it, you should be all set. Another way to utilize this 'feature' is to include a macro that checks the digital signature on the current file and only allows the workbook to be used if the digital signature matches the expected value.
 
chrish47,
Thanks for the clarification on the use of digital signatures. At least I know now that I need to add this to my checklist before deployment.
 
Does any of you Excel VB users have a macro that checks for a digital signature as Chrish47 suggested. I am having problems with the signature getting removed when the users save to their machines and then try to reuse the workbook (thereby the macros being disabled). I am not sure if the problem is because I am trying to share one workbook among people that are on Excel 2003 and Excel 2000. If putting a code in my macro when I open the workbook would help this situation, then I am all for it. Thanks.
 
Why don't you just sign the VB and leave the workbook unsigned?
 
That's all I've signed. Digital signature on VB project and the workbook password protected but I am still having problems with users on Excel 2003 enabling the macros. Some claim that they click on enable macros but the macro does not execute on open. That Open event should hide a warning page and unhide the working page but nothing happens. I only have problem with the 2003 users. I am thinking I'll just not use a signature. Is their a way to remove the certificate from my machine so I can create a workbook without the signed as being there? It attaches itself to any workbook I open.
 
Not sure, I use 2003 here with signed macros but don't have that issue.
 
Could this possibly be an issue with the way my users installed Excel 2003 on their machines? Since I have a signature on the project, if they open with "Enable Macros" on a medium setting, could this cause a problem after they save it since they are really not adding the signature to their machine? I am stumped. I think I'll take the signature off for now and force them to lower their security setting.
 
The macros should be the only thing you need to sign. It shouldn't have any issues if you sign the macros but not the workbook on medium security, at least from what I have used.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top