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

Hi,

I would like to protect the structure of a workbook.

I have tried

ActiveWorkbook.Protect Password:=pword, Structu=False
ActiveWorkbook.Protect (pword, True)

(where pword is a variable defined earlier)
and various other combinations.
I get a compile error in all cases - "Expected: ="

What am I doing wrong?

Eugene


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default protect workbook

Problem solved.

My password variable was a number which was not being accepted by
Activeworkbook.Protect. Changed it to a string using Cstr(pword) and it works.

Strange thing is that I used the same logic and commands to protect the
sheets in the workbook. ActiveSheet.Protect Password:=pword works when the
pword is an integer or other number.

Quite quirky if you ask me.

Eugene



"eugene" wrote:

Hi,

I would like to protect the structure of a workbook.

I have tried

ActiveWorkbook.Protect Password:=pword, Structu=False
ActiveWorkbook.Protect (pword, True)

(where pword is a variable defined earlier)
and various other combinations.
I get a compile error in all cases - "Expected: ="

What am I doing wrong?

Eugene


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
Can protect worksheet then workbook but not Protect and Share in code [email protected] Excel Programming 7 January 16th 17 07:01 AM
Protect Workbook Vs Protect Sheet Poor_pakistani New Users to Excel 4 May 25th 06 02:06 PM
Disable Tools, Protect, Protect Workbook Paul Moles Excel Programming 1 September 5th 05 03:37 PM
Running a macro to protect a workbook on a already protected workbook UNprotects the workbook ?? WimR Excel Programming 9 July 25th 05 12:44 PM
Protect Workbook hurlbut777 Excel Programming 0 December 28th 04 05:11 PM


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