Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Confused, again! Object variable not set?
This code is on the worksheet module. It hides the commandbar that is
unique to this sheet when the sheet is deactivated and erases the commandbar name from the worksheet so that XL doesn't try to hide the toolbar when the workbook is closed. Private Sub Worksheet_deActivate() Application.CommandBars("Abuse").Visible = False With wksMacRec .Unprotect Password:=PWORD<----ERROR .Range("E2").Value = "" .Protect Password:=PWORD End With 'ActiveWorkbook.Worksheets("Macro Records").Range("E2").Value = "" End Sub I'm getting an "object variable or with block variable not set" error. The password in set as a public constant in another module in this same workbook. So whatzzup? Thanks as always. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Object Variable Not Set Error on Selection object | Excel Worksheet Functions | |||
Run-time Error'91: Object variable or With block variable not set | Excel Programming | |||
Run-time error '91': "Object variable or With block variable not set | Excel Programming | |||
Confused with variable | Excel Programming | |||
Cells.Find error Object variable or With block variable not set | Excel Programming |