|
-
Apr 4th, 2004, 01:11 AM
#1
VBA - Create a Digital Signature - Trusted Certificate
Creating a trusted digital signature for your vba projects will
allow you to set your macro security to very high - only macros
installed in trusted locations will be allowed to run. All other
signed and unsigned macros are disabled.
This is the most secure level for macros.
Program Location:
For Office 2003:
?:\Program Files\Microsoft Office\OFFICE11\SELFCERT.EXE
For Office XP:
?:\Program Files\Microsoft Office\OFFICE10\SELFCERT.EXE
etc.
If you do not have the SELFCERT.EXE program you can find it on
your office CD or you can run setup again and install the Office
Tools.
Create the Digital Signature
Run the program and follow the simple step. It will create the
Digital Signature or "Certificate" for your vba projects.
Then in the VBA editor click Tools > Digital Signature... and click
Choose button and select the certificate you just created.
This will attach the signature to the project.
You can also set the security on Excel to High - only signed macros
from trusted sources will be run.
So only your macros will run.
To make you Digital Signature Certificate "Trusted"...
Export the Digital Signature
After you create your D.S. view it like when you assign the D.S. to
your VBA project - Tools > Digital Signature > Choose... > Select
your certificate > View Certificate > Details Tab > Copy to file...
Then you will see the Certificate Export wizard. Click Next > Next
> Next > Browse to where you want to save it to (*.cer) > Next >
Finish.
Import the Certificate
Browse to where you exported the certificate to and double click
it and wait for it to display the certificate. Then click Install
Certificate... > Next > Select "Place certificate in the following
store." and browse to "Trusted Root Certification Authorities" >
Next > Finish > Yes. Then your done.
Then check your VBA project's Digital Signature and it should
show that it is now "Trusted". If not, remove the Digital Signature
and then re-attach it to your VBA project again. You wil no longer
see the little red circle x before the certificate name.
Enjoy
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|