LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Problem using VBA for Excel to protect a Workbook with a passw

Thanks for the help with this. It worked fine. I've onlty been using Excel
VBA for 2 weeks (self-taught) and I'm still learning!

Thanks to Alan Hutchins too.

"Per Jessen" wrote:

Hi

Look at this line:

ActiveWorkbook.Protect Password:="abcd", Structu=True, Windows:=True

Regards,
Per

"Alan Smith" skrev i meddelelsen
...
I've developed a workbook with a number of sheets. I want to prevent users
from copying or deleting sheets without suitable control so I used Excel
VBA
code to protect and unprotect the workbook. The problem is that when I
protect the workbook with a password, when I get back to Excel I am able
to
unprotect the workbook without providing the password. Can anyone explain
what I'm doing wrong please? The code is:

dim wkbkone as workbook

Set wkbkone = Application.ActiveWorkbook
wkbkone.Protect "abcd"
wkbkone.Protect "abcd"
ActiveWorkbook.Protect Structu=True, Windows:=True



 
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 remove password protect to open Excel 2007 workbook JoWrobs Excel Discussion (Misc queries) 3 February 4th 10 11:18 PM
How do I password protect an excel workbook? Debbie B Excel Discussion (Misc queries) 2 August 3rd 09 01:05 PM
How do I password protect a workbook in Excel? Elmer Excel Discussion (Misc queries) 4 March 13th 08 06:50 PM
How to password protect several excel workbook pages using a macro p88t Excel Programming 2 September 28th 04 05:36 PM
password protect on workbook problem Jo[_6_] Excel Programming 1 January 19th 04 11:12 PM


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