LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default 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
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
Object Variable Not Set Error on Selection object Jean Excel Worksheet Functions 3 July 24th 06 06:45 PM
Run-time Error'91: Object variable or With block variable not set DynamiteSkippy Excel Programming 4 September 26th 05 07:47 AM
Run-time error '91': "Object variable or With block variable not set Mike[_92_] Excel Programming 2 December 30th 04 10:59 AM
Confused with variable Ray Batig Excel Programming 3 August 8th 04 12:40 AM
Cells.Find error Object variable or With block variable not set Peter[_21_] Excel Programming 2 May 8th 04 02:15 PM


All times are GMT +1. The time now is 07:44 AM.

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"