View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
davegb davegb is offline
external usenet poster
 
Posts: 573
Default first time class module

I want to hide a toolbar called "Abuse" when the workbook closes. I
looked it up in Walkenbach and tried to modify the code I found there
for my purpose. It doesn't work, but it doesn't hang either. Surprising
that it doesn't hang up.
Here is the code from the Class Module "HideToolbar"

Public WithEvents AppEvents As Application

Private Sub appevents_beforeclose()
Application.CommandBars("Abuse").Visible = False
End Sub

Here is the code from "ThisWorkbook":

Private Sub BeforeClose()
Call Init
End Sub

Here's the code from the regular module:

Dim AppObject As New HideToolbar
Sub Init()
Set AppObject.AppEvents = Application
End Sub

Any ideas on why it doesn't hide the toolbar?
Thanks in advance.