Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Ron Ron is offline
external usenet poster
 
Posts: 250
Default Password protecting multiple spreadsheets at once

I have a folder with 8000 spreadsheets, is there a way to PW protect all of
them at once, or will they need to be done manually?
--
Ron
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 793
Default Password protecting multiple spreadsheets at once

You need to write a Macro which will loop through all the files in the
specified folder and password protect all files.

Let me know if you want me to write that.

"Ron" wrote:

I have a folder with 8000 spreadsheets, is there a way to PW protect all of
them at once, or will they need to be done manually?
--
Ron

  #3   Report Post  
Posted to microsoft.public.excel.misc
Ron Ron is offline
external usenet poster
 
Posts: 250
Default Password protecting multiple spreadsheets at once

Thanks, that would be great if you could write that for me....
--
Ron


"Sheeloo" wrote:

You need to write a Macro which will loop through all the files in the
specified folder and password protect all files.

Let me know if you want me to write that.

"Ron" wrote:

I have a folder with 8000 spreadsheets, is there a way to PW protect all of
them at once, or will they need to be done manually?
--
Ron

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 793
Default Password protecting multiple spreadsheets at once

Ron,

Code (you can put this in a macro and run) with no error checking is given
below.
1. Replace "C:\" with the directory containing your files. Do not forget to
place '\' at the end of the path as I have done and enclose the path within
quotes.
2. It is assumed that all files in the directory are Excel files. This will
fail if this is not correct.
3. Also replace xyz123 with the password you want.

IMP: Do make a test folder, copy your files there and test this out...
before applying to your big folder. Even then do keep unprotected copies of
the fall till you are sure it works.

Sub SetPassword()
Dim fs, f, f1, fc, dirName, pw
dirName = "C:\"
pw = "xyz123"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(dirName)
Set fc = f.FileS
For Each f1 In fc
Workbooks.Open Filename:=dirName & f1.Name
Workbooks(Workbooks.Count).Activate
ActiveWorkbook.Password = pw
ActiveWorkbook.Close True
Next
MsgBox ("Password set on all files.")

End Sub

"Ron" wrote:

Thanks, that would be great if you could write that for me....
--
Ron


"Sheeloo" wrote:

You need to write a Macro which will loop through all the files in the
specified folder and password protect all files.

Let me know if you want me to write that.

"Ron" wrote:

I have a folder with 8000 spreadsheets, is there a way to PW protect all of
them at once, or will they need to be done manually?
--
Ron

  #5   Report Post  
Posted to microsoft.public.excel.misc
Ron Ron is offline
external usenet poster
 
Posts: 250
Default Password protecting multiple spreadsheets at once

Thank you very much.....
--
Ron


"Sheeloo" wrote:

Ron,

Code (you can put this in a macro and run) with no error checking is given
below.
1. Replace "C:\" with the directory containing your files. Do not forget to
place '\' at the end of the path as I have done and enclose the path within
quotes.
2. It is assumed that all files in the directory are Excel files. This will
fail if this is not correct.
3. Also replace xyz123 with the password you want.

IMP: Do make a test folder, copy your files there and test this out...
before applying to your big folder. Even then do keep unprotected copies of
the fall till you are sure it works.

Sub SetPassword()
Dim fs, f, f1, fc, dirName, pw
dirName = "C:\"
pw = "xyz123"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(dirName)
Set fc = f.FileS
For Each f1 In fc
Workbooks.Open Filename:=dirName & f1.Name
Workbooks(Workbooks.Count).Activate
ActiveWorkbook.Password = pw
ActiveWorkbook.Close True
Next
MsgBox ("Password set on all files.")

End Sub

"Ron" wrote:

Thanks, that would be great if you could write that for me....
--
Ron


"Sheeloo" wrote:

You need to write a Macro which will loop through all the files in the
specified folder and password protect all files.

Let me know if you want me to write that.

"Ron" wrote:

I have a folder with 8000 spreadsheets, is there a way to PW protect all of
them at once, or will they need to be done manually?
--
Ron

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
Protecting Spreadsheets joetahoe Excel Discussion (Misc queries) 1 June 4th 08 04:56 AM
password protect multiple spreadsheets in a workbook WORKSHEET PROTECTION Excel Worksheet Functions 3 October 26th 06 07:06 PM
Protecting spreadsheets I''m Still Here Excel Discussion (Misc queries) 0 March 26th 06 11:51 PM
Password Protecting Nick Excel Discussion (Misc queries) 6 June 30th 05 12:06 PM
Sheet Protecting password Nick Excel Discussion (Misc queries) 1 June 30th 05 12:43 AM


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