LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How can the macro open a sheet that is locked with a password

I make makros that can do a lot of things. I use the function for
protecting cells; where the code shall not be disturbed.
The makro have to unprotect the sheet; do the job; and then lock it again.
I want to use a password when i lock a sheet. That is simple.
But then the macro can't open it again.
Will somebody please tell me how to make a makro who unlocks a sheet with a
password.



Sub MyMakro()
ActiveSheet.Unprotect
'
'(I want a possibility to let the makro unprotect a sheet; who is protected
with a password)

' Here comes the VBA for what the makro shall do.

ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
ActiveSheet.EnableSelection = xlUnlockedCells
'(At least I want a possibility to let the makro protect the sheet with a
password)

End Sub

Thank you !!


Per R
Norway

--

Med hilsen

Per Roar Øgaard



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
forgotton password to open excel sheet Deepak Kamat Excel Discussion (Misc queries) 2 January 15th 10 02:25 AM
Password required in VBA to open the sheet Tia[_3_] Excel Worksheet Functions 2 October 12th 08 11:41 AM
Open a workbook with a password via macro - How to? fishy Excel Discussion (Misc queries) 1 February 29th 08 02:21 PM
Input password or open the sheet as "Read only Pietro Excel Discussion (Misc queries) 0 October 8th 07 09:40 PM
Macro Password to open or access Param Excel Worksheet Functions 0 March 6th 06 04:24 PM


All times are GMT +1. The time now is 05:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"