+ Reply to Thread
Results 1 to 7 of 7

running macros on protected sheets

  1. #1
    Forum Contributor
    Join Date
    04-08-2008
    Posts
    121

    running macros on protected sheets

    Hi,

    I've got a bit of code that unprotects the sheet and protects it again, so I can use macros,

    Please Login or Register  to view this content.
    however, the problem I have is that people can go in a view the password. I've tried assigning a VBA protection password on the code itself but it seems that you can't save a workbook like this.

    Is there any way round this. The code works brilliantly but don't want the uses to be able to see the password.

    Any ideas would be much appreciated.

    Thanks
    Harry
    Last edited by dominicb; 06-26-2008 at 06:45 AM.

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good morning baz0912

    You will need to password protect the VBE. From the VBE go to Tools > VBAProject Properties, Protection and insert your password.

    Caveat : Excel's password protection is not great (actually it's a disgrace) and can be removed in the twinkling of an eye, so don't trust anything too personal to it. Microsoft's view is that it's there more to prevent accidental erasure of important information that to protect sensitive information.

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Forum Contributor
    Join Date
    04-08-2008
    Posts
    121
    Hi DominicB,

    Thanks for your reply. The problem I have with this is that the users can't save workbooks with this protection in place? Is there a way round it?

    Thanks Harry

  4. #4
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Hi baz0912

    The problem I have with this is that the users can't save workbooks with this protection in place?
    Which protection? The VBE password protection?

    Why can't user's save it? What happens?

    This shouldn't cause a problem and I've never heard of it happening before. Can you elaborate a little.

    DominicB

  5. #5
    Forum Contributor
    Join Date
    04-08-2008
    Posts
    121
    Hi DominicB

    Yes, I go into the code as you suggested and properties/protection ans password protect the code and then when I go to save changes in my sheet it comes up with the following:


    "You can not save to the file format when the VBA project is protected.

    You may unprotect the VBA project by choosing the properties command on the visual basic Editor tools menuand enter the password for the active project"

    Does this happen when you go to save?

    Thanks
    Harry

  6. #6
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Hi baz0912

    You must be saving as an old version of Excel. From you file go to File > Save As. What does it say in the box marked Save as Type? Unless you are saving for backwards compatibility puposes, it should say Microsoft Office Excel Workbook (*.xls).

    HTH

    DominicB

  7. #7
    Forum Contributor
    Join Date
    04-08-2008
    Posts
    121
    DominicB

    Perfect - thanks

    Harry

+ 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