+ Reply to Thread
Results 1 to 8 of 8

Macro Security - Digital Certificates

Hybrid View

yawnzzzz Macro Security - Digital... 07-16-2010, 10:10 AM
elprup Re: Macro Security - Digital... 07-16-2010, 10:16 AM
elprup Re: Macro Security - Digital... 07-16-2010, 10:24 AM
elprup Re: Macro Security - Digital... 07-16-2010, 10:47 AM
royUK Re: Macro Security - Digital... 07-16-2010, 11:27 AM
shg Re: Macro Security - Digital... 07-16-2010, 11:51 AM
yawnzzzz Re: Macro Security - Digital... 07-16-2010, 02:19 PM
royUK Re: Macro Security - Digital... 07-16-2010, 02:35 PM
  1. #1
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387

    Macro Security - Digital Certificates

    I'm wanting to distribute an excel file containing VBA to many different people, and I'm hoping to avoid explaining how to change their macro security settings. It's going to differ by user on their version of Excel and what level of security is set, so I'm looking for the best approach to just make it work with zero or the least amount of user knowledge.

    For those on High Security, it appears that a digital certificate might be the best approach. Verisign seems to be the number one choice, but CACert offers a free certificate as well. I have a few questions:

    1) If I have a trusted digital signature on my workbook, will it still prompt the user notifying them that it's signed or will it just run?

    2) Is Verisign trusted by Microsoft Office? Or is there any advantage over using Verisign instead of CACert?

    3) I'm going to have the VBA locked down, so users can't touch it, but if a user were to enter information in a spreadsheet and save the workbook, would the signature become invalid when they open it again?

  2. #2
    Registered User
    Join Date
    05-01-2006
    Location
    OH
    MS-Off Ver
    Excel 2013
    Posts
    41

    Re: Macro Security - Digital Certificates

    You could have a sheet with a message that says they must enable macros in order to continue. Once they enable macros, then that sheet will get hidden and the sheet you want them to see would become unhidden. This way it wouldn't matter what settings they had. You're essentially forcing them to enable macros in order to use your file.

  3. #3
    Registered User
    Join Date
    05-01-2006
    Location
    OH
    MS-Off Ver
    Excel 2013
    Posts
    41

    Re: Macro Security - Digital Certificates

    Hmmm, I can't find my code where I did this sort of thing in the past. I believe this wasn't too hard to find on the internet. I remember when I did this I took what I found and then modified it a bit.

    You have to use workbook open and close events. I'll keep looking, but someone else will probably be able to fully help you sooner than me finding my file. I apologize for only providing partial help.

  4. #4
    Registered User
    Join Date
    05-01-2006
    Location
    OH
    MS-Off Ver
    Excel 2013
    Posts
    41

    Re: Macro Security - Digital Certificates

    Found it (which makes me feel better )

    Your stuff is on sheet1. Now, create a new sheet and put a simple message on it saying they must enable macros to continue. Hide sheet1. In the VB viewer window, double-click ThisWorkbook and copy+paste the code below into that window. Save your file as a macro enabled workbook and you should be ready to roll.


    Private Sub Workbook_Open()
    
        Sheets(1).Visible = True
        
    End Sub
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    
        Sheets(1).Visible = xlSheetVeryHidden
    
        
    End Sub

    ...actually, this wasn't the part I modified since these are only single lines.
    Last edited by elprup; 07-16-2010 at 10:54 AM.

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro Security - Digital Certificates

    Which version of Excel will be used?

    The Digital Signature on your computer will not apply to other PCs

    A digital signature becomes invalid when the VBA Project is altered by others,if the project is secured then this will reduce the chance of this happening.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Macro Security - Digital Certificates

    Users will be advised that you have a VeriSign certificate, and then asked (a), if they want to allow the code to run, and (b), if they always want to trust you as a publisher. If they do, they will not be prompted in the future.
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387

    Re: Macro Security - Digital Certificates

    Thanks for all the responses.

    Elprup, I'll consider that as a back-up plan.

    Shg, do you know if users will receive the exact same message for a CACert? I'd rather go with CACert since they're free, but I'm wondering what the differences might be. For instance, I'm guessing most firewalls allow verisign now, but might not allow cacert.

    Roy, I'm creating it in Excel 2007 and saving in 97-2003 compatibility mode. The users could be using any version of Excel. By your statement, do you mean that a Digital Signature for the VBA would still remain valid if a user changed spreadsheet values and saved? Do you know any circumstances that could cause a digital signature to become invalid if you have the vba locked (barring a user guessing the password)?

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro Security - Digital Certificates

    Only changing the VBA Code would affect the signature

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1