Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default using a macro to unproctect a password protected sheet

Is it possible to unprotect a sheet using a macro then manipulate data in the sheet and then repassword protect in the same macro
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default using a macro to unproctect a password protected sheet

Paul,

Try something like

Worksheets("Sheet1").Unprotect password:="whatever"
' your code here
Worksheets("Sheet1").Protect password:="whatever"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"paul d" wrote in message
...
Is it possible to unprotect a sheet using a macro then

manipulate data in the sheet and then repassword protect in the
same macro


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default using a macro to unproctect a password protected sheet

Paul

Yes it is.

Assuming the sheet has been previously protected with a password

Sub Test()
ActiveSheet.Unprotect Password:="password"

'do your manipulation steps here

ActiveSheet.Protect Password:="password", DrawingObjects:=True, _
Contents:=True, Scenarios:=True

End Sub

Gord Dibben Excel MVP



On Wed, 11 Feb 2004 16:31:05 -0800, paul d
wrote:

Is it possible to unprotect a sheet using a macro then manipulate data in the sheet and then repassword protect in the same macro


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default using a macro to unproctect a password protected sheet


You're a lifesaver works perfectl
----- Chip Pearson wrote: ----

Paul

Try something lik

Worksheets("Sheet1").Unprotect password:="whatever
' your code her
Worksheets("Sheet1").Protect password:="whatever


--
Cordially
Chip Pearso
Microsoft MVP - Exce
Pearson Software Consulting, LL
www.cpearson.co


"paul d" wrote in messag
..
Is it possible to unprotect a sheet using a macro the

manipulate data in the sheet and then repassword protect in th
same macr



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default using a macro to unproctect a password protected sheet

thank you so much works perfectly
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
macro to unlock and lock cells in password protected sheet Chris Excel Discussion (Misc queries) 3 February 26th 10 09:06 PM
how do i unproctect a work sheet, forgotten password craigcw Excel Discussion (Misc queries) 1 November 4th 09 04:46 PM
how to unproctect the sheet if password is not remember? how to decode the password if forget Excel Worksheet Functions 1 September 2nd 08 07:14 AM
How to see macro code of a password protected macro without a password? Dmitry Kopnichev Excel Worksheet Functions 5 October 27th 05 09:57 AM
VBa, Password protected sheet fails to get unprotected with the same password Hans Rattink Excel Programming 3 July 28th 03 02:30 PM


All times are GMT +1. The time now is 07:51 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"