Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Unlocking for viewing (in VBE)

Assuming all my passwords are "abc"

To unprotect my active sheet, I do
ActiveSheet.Unprotect abc

To unprotect my write protected workbook, I do
Workbooks.Open Filename:=TargetPathAndName, WriteResPassword:= abc

But to unlock for viewing in VBE, my module1 under Project Name Book, what
the code like?

Many thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default Unlocking for viewing (in VBE)

It can be done, but it involves the use of SendKeys which isn't too stable.

This is an example, but you may need to tune it


With Application
.SendKeys "%{F11}", True ' VBE
.SendKeys "^r", True ' Set focus to Explorer
.SendKeys "{TAB}", True ' Tab to locked project
.SendKeys "~", True ' Enter
.SendKeys "password"
.SendKeys "~", True ' Enter
End With


--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"Edmund" wrote in message
...
Assuming all my passwords are "abc"

To unprotect my active sheet, I do..
ActiveSheet.Unprotect "abc"

To unprotect my write protected workbook, I do..
Workbooks.Open Filename:=TargetPathAndName, WriteResPassword:= "abc"

But to "unlock for viewing" in VBE, my module1 under Project Name Book,

what
the code like?

Many thanks



Reply
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
Unlocking a Workbook Jeff Excel Discussion (Misc queries) 2 June 2nd 09 04:28 PM
unlocking a row AJ Excel Discussion (Misc queries) 3 February 26th 09 02:38 PM
Unlocking cells maltagirl Excel Discussion (Misc queries) 3 June 16th 08 07:20 PM
Locking and unlocking a Excel project for viewing VJ Excel Programming 3 April 7th 05 09:33 PM
Unlocking in 97 Wes[_5_] Excel Programming 4 October 17th 03 09:46 PM


All times are GMT +1. The time now is 04:34 PM.

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

About Us

"It's about Microsoft Excel"