Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default Open Workbooks and Password Protect all Worksheets

Hi all, I need macro which should open all excel workbooks one by one
in folder "C:\Document\Record\" and protect all worksheets in each
workbook with password "REC". I tried few my own experiments but I am
not getting any success. Please can any friend can help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Open Workbooks and Password Protect all Worksheets

Hi K

Here is a basic macro
http://www.rondebruin.nl/copy4.htm

Replace the red code block with something like this

On Error Resume Next
For Each sh In mybook.Worksheets
If sh.ProtectContents = False Then
With sh
.Protect = "REC"
End With
Else
ErrorYes = True
End If
Next sh



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"K" wrote in message ...
Hi all, I need macro which should open all excel workbooks one by one
in folder "C:\Document\Record\" and protect all worksheets in each
workbook with password "REC". I tried few my own experiments but I am
not getting any success. Please can any friend can help.

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
How to password protect multiple workbooks? bodeene Excel Discussion (Misc queries) 1 April 8th 10 09:51 PM
Linking to Password Protect Workbooks Paul Ferris Excel Discussion (Misc queries) 23 November 3rd 07 01:30 PM
Password Protect Multiple Workbooks [email protected] Excel Discussion (Misc queries) 4 September 25th 07 04:31 PM
password protect copies of workbooks dave caizley Excel Discussion (Misc queries) 1 September 21st 07 07:59 PM
Password protect a folder with several workbooks tbugs Excel Discussion (Misc queries) 1 August 7th 06 09:06 AM


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