Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Auto assign password to existing files

I have a need to automate me assinging passwords to say 50 different excel
workbooks. These workbooks have a common format for the filename - it is
DEPTxxx - where xxx is the actual department. I need a program to read the
folder where these are stored, open, place a password on the document and
save the file. Additionally the filename and associated password need to be
recoreded - obviosly. The password would be great it if was auto-generated
or retrieved from an existing sheet of names or something. Does this make
sense?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Auto assign password to existing files

If you don't ever know where the files are located, you could go into DOS and
create a text file:

Dir /b /s DEPT*.xls C:\FileList.txt

Then use this text file as your list of Deptxxx.xls files ...

Open "C:\FileList.txt" for input as #1
For each file in filelist.txt
Open
Assign Password
Save
Close
Next

That might handle part of the problem anyhow.

It doesn't look like the password gets recorded anyhwe

ActiveWorkbook.Protect Structu=True, Windows:=False

So you might be able to do a SEND KEYS command to type in each password.

Let me know if any of this helps.

"jay" wrote:

I have a need to automate me assinging passwords to say 50 different excel
workbooks. These workbooks have a common format for the filename - it is
DEPTxxx - where xxx is the actual department. I need a program to read the
folder where these are stored, open, place a password on the document and
save the file. Additionally the filename and associated password need to be
recoreded - obviosly. The password would be great it if was auto-generated
or retrieved from an existing sheet of names or something. Does this make
sense?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Auto assign password to existing files

This works:

'You would generate a random password and replace "password" here
strRandom = "password"

Open the Deptxxx.xls

Open "C:\pwdList.txt" For Append As #1

Print #1, Filename & Path & strRandom

SendKeys "%TPW" & strRandom & "~" & strRandom & "~", True

Close #1
Close & Save Deptxxx.xls


"jay" wrote:

I have a need to automate me assinging passwords to say 50 different excel
workbooks. These workbooks have a common format for the filename - it is
DEPTxxx - where xxx is the actual department. I need a program to read the
folder where these are stored, open, place a password on the document and
save the file. Additionally the filename and associated password need to be
recoreded - obviosly. The password would be great it if was auto-generated
or retrieved from an existing sheet of names or something. Does this make
sense?

  #4   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Auto assign password to existing files

OK, I am a little "lost" and I know you probably think what the heck is guy
thinking - smile. I don't know alot of programming or anything. I was
hopeing I could somehow download a list of names/object somewhere and put
them in an excel worksheet that I could then use to pull all the passwords.
Of course I would need to pick a password randomly from that list. I wasn't
sure how this was automatec and how/if it tracked the password and filename
it assigned to?

If I have a number of xcel workbooks and I want to somehow feed those names
into a worksheet for my "file password status" - good idea - maybe have a
workbook that contains the filenames in one column, an assigned password
column, a status indicator that it has been completed column and then another
worksheet that contains the "source" of passwords.

Then I would "copy" the code from one of you wizard's, slightly modify it to
protect the innocent and then justify why working on this site is a good idea
(to my boss). Thanks again for any help....

"Access101" wrote:

This works:

'You would generate a random password and replace "password" here
strRandom = "password"

Open the Deptxxx.xls

Open "C:\pwdList.txt" For Append As #1

Print #1, Filename & Path & strRandom

SendKeys "%TPW" & strRandom & "~" & strRandom & "~", True

Close #1
Close & Save Deptxxx.xls


"jay" wrote:

I have a need to automate me assinging passwords to say 50 different excel
workbooks. These workbooks have a common format for the filename - it is
DEPTxxx - where xxx is the actual department. I need a program to read the
folder where these are stored, open, place a password on the document and
save the file. Additionally the filename and associated password need to be
recoreded - obviosly. The password would be great it if was auto-generated
or retrieved from an existing sheet of names or something. Does this make
sense?

  #5   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Auto assign password to existing files



"jay" wrote:

OK, I am a little "lost" and I know you probably think what the heck is guy
thinking - smile. I don't know alot of programming or anything. I was
hopeing I could somehow download a list of names/object somewhere and put
them in an excel worksheet that I could then use to pull all the passwords.
Of course I would need to pick a password randomly from that list. I wasn't
sure how this was automatec and how/if it tracked the password and filename
it assigned to?

If I have a number of xcel workbooks and I want to somehow feed those names
into a worksheet for my "file password status" - good idea - maybe have a
workbook that contains the filenames in one column, an assigned password
column, a status indicator that it has been completed column and then another
worksheet that contains the "source" of passwords.

Then I would "copy" the code from one of you wizard's, slightly modify it to
protect the innocent and then justify why working on this site is a good idea
(to my boss). Thanks again for any help....

"Access101" wrote:

This works:

'You would generate a random password and replace "password" here
strRandom = "password"

Open the Deptxxx.xls

Open "C:\pwdList.txt" For Append As #1

Print #1, Filename & Path & strRandom

SendKeys "%TPW" & strRandom & "~" & strRandom & "~", True

Close #1
Close & Save Deptxxx.xls


"jay" wrote:

I have a need to automate me assinging passwords to say 50 different excel
workbooks. These workbooks have a common format for the filename - it is
DEPTxxx - where xxx is the actual department. I need a program to read the
folder where these are stored, open, place a password on the document and
save the file. Additionally the filename and associated password need to be
recoreded - obviosly. The password would be great it if was auto-generated
or retrieved from an existing sheet of names or something. Does this make
sense?



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 auto assign po numbers in Excel Cathy Landry Excel Worksheet Functions 5 August 21st 05 12:14 AM
Applying Existing Password to New Spreadsheet Vic Excel Discussion (Misc queries) 1 January 27th 05 12:37 AM
assign auto number and auto date Krit Kasem Excel Discussion (Misc queries) 2 January 14th 05 02:55 AM
Need to set up Macro to save/replace existing doc with password Kate Excel Programming 0 September 9th 04 07:31 PM
Numbering files according to existing files mr Excel Programming 1 June 21st 04 03:53 PM


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