Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Password protected workbook

I have a master file that requires data feeds from multiple users. The way
it works is as follows: the user maintains their data in a separate Excel
file, then clicks a button to UPLOAD their data into the master file (which
basically opens the master file, then copies/pastes the data in). I want to
password protect the master file so no one else can make changes with the
exception of this uploaded data. How do I update my VB code to "enter" the
file password when opening the master file during this upload process, while
ensuring the user does not see or know the password?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Password protected workbook

put somthing like this after you open the master file

Worksheets(1).Unprotect "password"

put somthing like this before closing master file

Worksheets(1).Protect "password", True

and im assuming you have all cells protected
"JDaywalt" wrote:

I have a master file that requires data feeds from multiple users. The way
it works is as follows: the user maintains their data in a separate Excel
file, then clicks a button to UPLOAD their data into the master file (which
basically opens the master file, then copies/pastes the data in). I want to
password protect the master file so no one else can make changes with the
exception of this uploaded data. How do I update my VB code to "enter" the
file password when opening the master file during this upload process, while
ensuring the user does not see or know the password?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Password protected workbook

Actually, it is not the workSHEET that is protected -- it is the workBOOK.
In other words, normally, when you open the master file, it tells you it can
only be opened in Read Only mode. The user would then have to do a File...
SaveAs if they wanted to save changes (the original file would remain
intact).

For this purpose, however, when the user selects the "upload" macro, I want
the master file to be opened with the password so the macro can be copy in
the user's data, and resave the file with the normal password. Does that
make sense?

"Mike" wrote:

put somthing like this after you open the master file

Worksheets(1).Unprotect "password"

put somthing like this before closing master file

Worksheets(1).Protect "password", True

and im assuming you have all cells protected
"JDaywalt" wrote:

I have a master file that requires data feeds from multiple users. The way
it works is as follows: the user maintains their data in a separate Excel
file, then clicks a button to UPLOAD their data into the master file (which
basically opens the master file, then copies/pastes the data in). I want to
password protect the master file so no one else can make changes with the
exception of this uploaded data. How do I update my VB code to "enter" the
file password when opening the master file during this upload process, while
ensuring the user does not see or know the password?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Password protected workbook

ActiveWorkbook.Protect "password", True
ActiveWorkbook.Unprotect "password"
This should work the same as my other post if not post you code and I 'll
see what I can do
"JDaywalt" wrote:

Actually, it is not the workSHEET that is protected -- it is the workBOOK.
In other words, normally, when you open the master file, it tells you it can
only be opened in Read Only mode. The user would then have to do a File...
SaveAs if they wanted to save changes (the original file would remain
intact).

For this purpose, however, when the user selects the "upload" macro, I want
the master file to be opened with the password so the macro can be copy in
the user's data, and resave the file with the normal password. Does that
make sense?

"Mike" wrote:

put somthing like this after you open the master file

Worksheets(1).Unprotect "password"

put somthing like this before closing master file

Worksheets(1).Protect "password", True

and im assuming you have all cells protected
"JDaywalt" wrote:

I have a master file that requires data feeds from multiple users. The way
it works is as follows: the user maintains their data in a separate Excel
file, then clicks a button to UPLOAD their data into the master file (which
basically opens the master file, then copies/pastes the data in). I want to
password protect the master file so no one else can make changes with the
exception of this uploaded data. How do I update my VB code to "enter" the
file password when opening the master file during this upload process, while
ensuring the user does not see or know the password?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Password protected workbook

Post more of your code for me

"JDaywalt" wrote:

OK, I must have something wrong or perhaps out of sequence. When the macro
attempted to open the Master File, it still prompted me for a password. Here
are the two lines of code. (MasterFile is a variable for the actual file
name; xyz is the password). Recall that when the code is initially executed,
the ActiveWorkbook is the user file, not the master. Getting closer!

Workbooks.Open Filename:=MasterFile
ActiveWorkbook.Unprotect (xyz)



"Mike" wrote:

ActiveWorkbook.Protect "password", True
ActiveWorkbook.Unprotect "password"
This should work the same as my other post if not post you code and I 'll
see what I can do
"JDaywalt" wrote:

Actually, it is not the workSHEET that is protected -- it is the workBOOK.
In other words, normally, when you open the master file, it tells you it can
only be opened in Read Only mode. The user would then have to do a File...
SaveAs if they wanted to save changes (the original file would remain
intact).

For this purpose, however, when the user selects the "upload" macro, I want
the master file to be opened with the password so the macro can be copy in
the user's data, and resave the file with the normal password. Does that
make sense?

"Mike" wrote:

put somthing like this after you open the master file

Worksheets(1).Unprotect "password"

put somthing like this before closing master file

Worksheets(1).Protect "password", True

and im assuming you have all cells protected
"JDaywalt" wrote:

I have a master file that requires data feeds from multiple users. The way
it works is as follows: the user maintains their data in a separate Excel
file, then clicks a button to UPLOAD their data into the master file (which
basically opens the master file, then copies/pastes the data in). I want to
password protect the master file so no one else can make changes with the
exception of this uploaded data. How do I update my VB code to "enter" the
file password when opening the master file during this upload process, while
ensuring the user does not see or know the password?

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
Password protected workbook Moin Excel Discussion (Misc queries) 2 April 2nd 09 09:53 PM
password protected workbook Ann Excel Worksheet Functions 4 July 10th 08 10:47 PM
How To Get Into a Password Protected Workbook Donald Excel Programming 2 August 29th 06 07:18 PM
Multiple workbook user's with Master workbook - all password protected Yvon Excel Discussion (Misc queries) 2 March 30th 05 01:34 PM
Open a password protected excel workbook from second workbook to fetch data using dynamic connection kaustav choudhury Excel Programming 2 April 3rd 04 06:18 AM


All times are GMT +1. The time now is 11:24 AM.

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"