Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Macro to re-protect sheet w/ original password after pasting valuesin new book

Hello,

I have built a large file with many hidden and password protected
sheets and formulas. The end user of the file manipulates several
cells on two visible sheets and then sends the entire workbook back to
me. I only need a hardcoded record of the two sheets they manipulate.

To save bandwidth, I am trying to build a button that will copy the
two sheets to a new workbook and paste the values on those new
sheets. This will allow the user to send me a much smaller file in
return. I am getting stuck with the password protection, as I want
both workbooks to remain protected upon completion of the macro. I
have built the command button and simply can't figure out how to
unprotect and then re-protect (with the original password after
pasting the values) the two tabs in the new workbook. Any help is
appreciated.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,533
Default Macro to re-protect sheet w/ original password after pasting values in new book

Hi

I think it's something like this you need:

Sub test()
Dim New_Wb As Workbook
MyPass = "InitPass"
Set New_Wb = Workbooks.Add
'Copy data
New_Wb.Protect Password:=MyPass

New_Wb.Close
ThisWorkbook.Protect Password:=MyPass

End Sub

Regards,
Per

skrev i meddelelsen
...
Hello,

I have built a large file with many hidden and password protected
sheets and formulas. The end user of the file manipulates several
cells on two visible sheets and then sends the entire workbook back to
me. I only need a hardcoded record of the two sheets they manipulate.

To save bandwidth, I am trying to build a button that will copy the
two sheets to a new workbook and paste the values on those new
sheets. This will allow the user to send me a much smaller file in
return. I am getting stuck with the password protection, as I want
both workbooks to remain protected upon completion of the macro. I
have built the command button and simply can't figure out how to
unprotect and then re-protect (with the original password after
pasting the values) the two tabs in the new workbook. Any help is
appreciated.

Thanks.


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
Code to protect/unprotect a sheet using a macro with password FredH Excel Discussion (Misc queries) 5 October 23rd 07 04:49 PM
Protect sheet without password? EllenM Excel Discussion (Misc queries) 2 June 21st 07 03:22 PM
password protect a single sheet Stefi Excel Discussion (Misc queries) 0 March 28th 07 01:52 AM
Password Protect a Sheet Lynn Excel Discussion (Misc queries) 1 October 27th 06 03:41 PM
how do I protect formula's only, not entire sheet or book? Beginner Excel User Setting up and Configuration of Excel 2 February 16th 06 09:07 PM


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