VBA - Create a Digital Signature - Trusted Certificate-VBForums
Results 1 to 9 of 9

Thread: VBA - Create a Digital Signature - Trusted Certificate

  1. #1

    Thread Starter
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,154

    Cool 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!
    Star Wars Gangsta Rap Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel Core 2 Extreme Ed., 2 WD Raptor 10K RPM 300 GB HDs, 2 GBs DDR2 667 MHz RAM, 2 Viewsonic 24" LCDs, Windows 7 SP-1/Windows 8.1, Office 2010, VS 2013

  2. #2
    New Member
    Join Date
    Aug 2004
    Location
    HK
    Posts
    1

    Thumbs up

    Hi,

    I'm new here....

    Thank you! I'm looking for this also...

    BTW, I notice a problem if user using Office Word 2003 with "very high" security level setting... the user will not be able to accept any signed macro...

    Is there a way to detect the security level setting, and prompt the user to CHANGE the security level setting instead? If it is possible, would you please to give me a hand on this?


    Thank you!
    Arnold

  3. #3

    Thread Starter
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,154

    Re: VBA - Create a Digital Signature - Trusted Certificate

    The Digital Signatures are only valid up to the High security level.
    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!
    Star Wars Gangsta Rap Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel Core 2 Extreme Ed., 2 WD Raptor 10K RPM 300 GB HDs, 2 GBs DDR2 667 MHz RAM, 2 Viewsonic 24" LCDs, Windows 7 SP-1/Windows 8.1, Office 2010, VS 2013

  4. #4
    New Member
    Join Date
    Feb 2007
    Posts
    7

    Smile Re: VBA - Create a Digital Signature - Trusted Certificate

    Hi RobDog,

    Thanks to share a great info, i am a newbie for VB and VBA. Currently starting to learn about create program with VB and VBA. I am intersted with Digital signature which is allow user to enable macro that programmer created.

    I already tried your advice but still have question about this.
    1. Could some one hack the digital signature??
    2. how to make automatitation for digital signature with my program in VBA excel or with VB
    3. how to distribute this digital signature to other computer so they can able my program eventough the level security is high

    thank you for your reply
    i really appreciate your kind to answer this

    thanks again

  5. #5

    Thread Starter
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,154

    Re: VBA - Create a Digital Signature - Trusted Certificate

    Welcome to the Forums.

    1. Anything is always possible.
    2. What do you mean make automation for digital signature?
    2. Cant, digital signatures are generated off of the systems hardware specs and other specs to make it only valid for that workstation.
    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!
    Star Wars Gangsta Rap Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel Core 2 Extreme Ed., 2 WD Raptor 10K RPM 300 GB HDs, 2 GBs DDR2 667 MHz RAM, 2 Viewsonic 24" LCDs, Windows 7 SP-1/Windows 8.1, Office 2010, VS 2013

  6. #6
    New Member
    Join Date
    Feb 2007
    Posts
    7

    Re: VBA - Create a Digital Signature - Trusted Certificate

    Quote Originally Posted by RobDog888
    Welcome to the Forums.

    1. Anything is always possible.
    2. What do you mean make automation for digital signature?
    3. Cant, digital signatures are generated off of the systems hardware specs and other specs to make it only valid for that workstation.
    Thanks for your answer...

    Question on nbr 2, in case if digital signature could distribute to other computer than macro will an automate to install it to client compt directly if client open the excel containing that macro.

    its just my idea

  7. #7

    Thread Starter
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,154

    Re: VBA - Create a Digital Signature - Trusted Certificate

    Oh I see. One other option is to purchase a certificate from a public authority. They are not cheap but if you have a commercial product to distribute then its worth it.
    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!
    Star Wars Gangsta Rap Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel Core 2 Extreme Ed., 2 WD Raptor 10K RPM 300 GB HDs, 2 GBs DDR2 667 MHz RAM, 2 Viewsonic 24" LCDs, Windows 7 SP-1/Windows 8.1, Office 2010, VS 2013

  8. #8
    New Member
    Join Date
    Feb 2007
    Posts
    7

    Re: VBA - Create a Digital Signature - Trusted Certificate

    Quote Originally Posted by RobDog888
    Oh I see. One other option is to purchase a certificate from a public authority. They are not cheap but if you have a commercial product to distribute then its worth it.
    Yeah, i already search those program.... but unfortunately my program is so simple and it will become not worthy to buy certificate soft....

    but anyway thanks again for your advice....

  9. #9
    New Member
    Join Date
    Feb 2010
    Posts
    1

    Re: VBA - Create a Digital Signature - Trusted Certificate

    I have a Excel file which has the Ditigital Signature >> Created by Selfcert.exe

    I have to distribute this file to locations where pelope wont be knowing the Excel Macro concept also. is there a way where the Certificate automatically gets installed.
    It works fine for office 97/2000 but my macros are disabled by default in office 2007

    Please help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.