View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Vasant Nanavati Vasant Nanavati is offline
external usenet poster
 
Posts: 1,080
Default add-ins & events

I'm a bit confused. Add-ins are hidden workbooks. How does an add-in get
activated and deactivated? Or get sheets added to it? ThisWorkbook is the
workbook containing the code; i.e., the add-in. Perhaps you are confusing
the ActiveWorkbook and ThisWorkbook objects.

--

Vasant



"Eric" wrote in message
ink.net...
Fair enough :-)

It's located in the add-in's ThisWorkbook module as below - pretty vanilla
stuff, and it WILL work if I manaully make it work, but I want the event

to
trigger it.

Thanks, Eric

Private Sub Workbook_Activate()
Call SetToolbarStateToCustom(TOOLBAR_NAME)
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Call SetToolbarStateToNormal(TOOLBAR_NAME, doPermanently:=True)
End Sub

Private Sub Workbook_Deactivate()
Call SetToolbarStateToNormal(TOOLBAR_NAME, doPermanently:=False)
End Sub

Private Sub Workbook_NewSheet(ByVal Sh As Object)
Call SetToolbarStateToNormal(TOOLBAR_NAME, doPermanently:=False)
End Sub

Private Sub Workbook_Open()
modMain.Initialize
End Sub

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
How about some specifics on the code and events that are not working?

:-)

--

Vasant


"Eric" wrote in message
ink.net...
I made an add-in with code to fir the ThisWorkbook of the add-in, but

it
doesn't seem to be working now that I've added the add-in into another
workbook.

It seems silly to make an add-in and then have to put vba code in the
host
workbook, so what's the right way to do this?

Thanks, Eric