rosands
There are a couple of problems that need to be resolved when you write Macros in Excel. Microsoft – in their self-proclaimed wisdom (is it an exalted state or is it just obnoxious) – decided that every macro is a potential virus threat. So they instituted a Certification process that does work fairly well. It allows Trusted companies to issue Digital Certificates to other Trusted companies for a price. A Spreadsheet (or any MS file) that contains an embedded Macro that has a Digital Certificate runs without question (well – sort of). Without a Certificate – by default – all macros are ignored – even the ones that you create on your system for your own use.
This can be overcome by changing the Security Level in Excel from High to Medium - which prompts you when the file is opened. Selecting Tools\Macro\Security does this – The warning message is VERY UGLY and is almost guaranteed to make most people disable the Macro. I use this setting primarily during a Macro’s testing stage.
SolidWorks chose to follow Microsoft’s lead. If there is a Design Table in a Model or a Drawing that contains a Macro without a certificate – and the Security Level is High – the Macro is ignored. If the Security Level is Medium – then you get SolidWorks version of a VERY UGLY message (it still has the same guarantee though).
A Digital Certificate is needed to use a finished Macro so that you do not see this message. Microsoft included a program to do this that avoids the cost of getting certified by another company – but the drawback is that every machine that will run the macro needs to run this program first and have a Certificate with the same name. – Start Windows Explorer and look in your Program Files\Microsoft Office\Office directory for the program named SelfCert.Exe - This program is not always installed by Office so if it doesn’t exist you can find it on your installation CD (or you can download it from
Each time you run SelfCert.Exe – it will create a Digital Certificate on your system with the name you give it. – If other people will be using these files and your macros – They need to run the program on their system as well - I would suggest that you use your company name or the company’s initials for the Certification’s Name rather than your own name.
Once this is accomplished – Start Excel and save the new spreadsheet to someplace where you can find it again (like your desktop) - Do a Tools\Macro\Visual Basic Editor – In the VBA editor do a Tools\Digital Signatures and select the Choose button – Your new certificate will be displayed – Select it and hit OK twice – Hit Save in the VBA editor and close it
If you changed your Security Level – you should reset it to High – Tools\Macro\Security – and close Excel.
Now – any time that you need to create a macro in a spreadsheet you can use this file as a template. If you choose to start a new file – you will need to select the Digital Signature within the macro.
Lee
Consciousness: That annoying time between naps.