Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Unlock protected worksheet

I have sent 2006 Budget worksheets to all my franchises, who have entered
data already. I've added some features that I want them to use and want to
copy their data into the new worksheet. I also want to create macro that
writes a statement in a protected field. All the sheets are protected with a
password I do not want them to knowm but they do have access to certain cells
to enter their data.
When I send the new worksheet, I want to create a macro that copies their
data and then writes that the import is done.
How can I use the macro to unprotect a sheet, write the statement, protect
the sheet again, and make sure they do not have access to the password?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Unlock protected worksheet

There is no absolutely foolproof way to ensure taht they can not get access
the the password. There are any number of code solutions to crack password.
That being said assuming the the users are not fiendish then yo just need to
lock the project int the VBE. Right click the project and select security.
check to hide the code and add a password. Here is some code for you...

Sub ImportData()
Dim wksCopyfrom as worksheet
dim wksCopyto as worksheet

set wskcopyfrom = sheets("Sheet1")
set wskcopyto = sheets("Sheet2")

wkscopyfrom.unprotect "MyPassword"
wkscopyto.unprotect "MyPassword"
wkscopyfrom.range("A1").copy wkscopyto.range("A1")
wkscopyfrom.protect "MyPassword"
wkscopyto.protect "MyPassword"

end Sub
--
HTH...

Jim Thomlinson


"David" wrote:

I have sent 2006 Budget worksheets to all my franchises, who have entered
data already. I've added some features that I want them to use and want to
copy their data into the new worksheet. I also want to create macro that
writes a statement in a protected field. All the sheets are protected with a
password I do not want them to knowm but they do have access to certain cells
to enter their data.
When I send the new worksheet, I want to create a macro that copies their
data and then writes that the import is done.
How can I use the macro to unprotect a sheet, write the statement, protect
the sheet again, and make sure they do not have access to the password?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Unlock protected worksheet


Good morning David

Alternatively this line will enable macros to write to protected cells
and users not to.

Activesheet.Protect UserInterfaceOnly=True

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=486609

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 do I unlock the excell password protected file? Soloizabela Excel Discussion (Misc queries) 2 October 2nd 08 09:15 PM
How do I unlock a protected worksheet Terry Swift Excel Worksheet Functions 2 August 2nd 05 01:14 AM
How do i unlock protected worksheets? jamesbialek Excel Worksheet Functions 1 June 22nd 05 01:02 PM
How do I unlock specific cells in a spreadsheet that I protected? onemanhattanrebel Excel Discussion (Misc queries) 1 May 8th 05 04:54 PM
How do I unlock a spreadsheet that is password protected? Moke Excel Worksheet Functions 4 April 26th 05 03:27 AM


All times are GMT +1. The time now is 04:06 PM.

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"