Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

workbook not maximizing when protection is on 1

Status
Not open for further replies.

ajking

Technical User
Aug 13, 2002
229
I have an excel form which, when it is opened normally will open maximized but when I put workbook protection on, the next time it is opened it opens in a reduced sized window
I tried the following without success:

Private Sub Workbook_Open()
With Application
.WindowState = xlMaximized
End With
End Sub

any suggestions would be much appreciated. TIA

'Life is what happens to you while you are busy making other plans' John W. Lennon 1940-1980
 
You can apply different types of workbook protection - one of which is "Windows". If the windows are protected, you cannot change the state. From excel help on workbook protection:

Excel Help said:
Protect method as it applies to the Workbook object.

Protects a workbook so that it cannot be modified.

expression.Protect(Password, Structure, Windows)
expression Required. An expression that returns a Workbook object.

Password Optional Variant. A string that specifies a case-sensitive password for the worksheet or workbook. If this argument is omitted, you can unprotect the worksheet or workbook without using a password. Otherwise, you must specify the password to unprotect the worksheet or workbook. If you forget the password, you cannot unprotect the worksheet or workbook. It's a good idea to keep a list of your passwords and their corresponding document names in a safe place.

Structure Optional Variant. True to protect the structure of the workbook (the relative position of the sheets). The default value is False.

Windows Optional Variant. True to protect the workbook windows. If this argument is omitted, the windows aren’t protected.

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Hi Geoff

Many thanks, It makes sense now but yesterday, at 16:20 when everything than could go wrong,went wrong, your brain has gone into terminal meltdown and someone has taken the last teabag; you tend to not see what's obvious!
Once again many thanks for the post

regards

Alan

'Life is what happens to you while you are busy making other plans' John W. Lennon 1940-1980
 
[lol] I know the situation. No worries

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top