12 August, 2009

Word, "This file contains macros with an expired..."

I started getting this error message when I opened Word, "This file contains macros with an expired or revoked signature." In my case, this was due to a Global Template Add-in that had an expired certificate. Word behaves differently depending on the Macro Security level.
  • Very High: You only get a message that macros are disable for this project.
  • High: You get an initial error message of "This file contains macros with an expired or revoked signature," before the prompt of macros being disabled.
  • Medium: You get the option to Disable or Enable the specific macro. This dialog box will also provide some clues as to the source of the problem.
  • Low: No warning or disabling of any macros.
To change the Macro Security, go to Tools >> Macro >> Security...

With an expired Certificate, if you still want to use the macro or template, you either need to set the Macro Security to Medium or Low. A Low setting can open you up for other problems, while Medium requires a click every time you open Word. The best solution is to remove the offending macro and get a new one with an updated Certificate from the creator.

Here's how you remove a Global Template Add-in:
  1. Set your Macro Security to Medium (see above)
  2. Close and Restart Word (and Outlook too, if you use Word as your Email Editor)
  3. Restart Word and note the name of the macro template causing the problem

  4. Go to Tools >> Templates and Add-ins
  5. On the "Templates" tab, in the "Global templates and add-ins" section, find the template or add-in mentioned in the dialog box of step 3, and uncheck it
  6. Click OK
  7. Set your Macro Security back to High
  8. Close and Restart Word
If the problem persists, i.e the template persists, do these additional steps.
  1. Repeat steps 1 - 3 above, and note the name and path of the template (e.g. C:\Program Files\Microsoft Office\OFFICE11\STARTUP\sforce.dot)
  2. Close Word (and Outlook if necessary)
  3. Go to the path you just noted and delete the template file
  4. Restart Word
This solved the problem for me; Word seems to be working just fine again.

04 August, 2009

MS Access -- Run-time error '3464'

Being that I don't use MS Access often, I always look for examples of my prior work to assist me with my new problem. Today I ran into this error, Run-time error '3464': Data type mismatch in criteria expression, which was a good reminder. When writing a VBA query, Text needs wrapping in quotes, Dates need wrapping in hashes, and numbers need neither of these. If you get it wrong, you'll get the 3464 error message.