Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50099

[SOLVED] Password Protection and Disapling Macros

$
0
0
Hello,

I'm putting a password on my workbook, and I want to disable certain buttons if the workbook is opened in 'Read Only'

This is what I have so far in the module,
Code:

Private Sub Workbook_Open()
 
    If ThisWorkbook.ReadOnly Then
   
        Sheets("Home Page").Maintenancebtn.Enabled = False
        Sheets("Home Page").Contractorsbtn.Enabled = False
        Sheets("Current Maintenance").UpdateHistory1.Enabled = False
        Sheets("Current Contractors").UpdateHistory2.Enabled = False
 
    End If

End Sub

This code came from: http://www.mrexcel.com/forum/excel-q...read-only.html

But nothing is happening, it's still allowing me to click the buttons.

I have attached a version of my old work book. If you plan on editing and re attaching, please use the password of '1234'

Many Thanks :)
Attached Files

Viewing all articles
Browse latest Browse all 50099

Trending Articles