Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 148
Default removing a toolbar with code

I have been trying to get a file to remove a toolbar when the file is closed.
Currently the toolbar is generated with code upon opening the file. This
works good.
But, I cannot figure out how to get it to delete when I close the file.
This is what I have at this point:

Private Sub App_WorkbookBeforeClose(ByVal Wb As Workbook, _
Cancel As Boolean)
Application.CommandBars("my toolbar").Delete
Cancel = False

End Sub

TIA
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default removing a toolbar with code

What you show is an application level event. Assuming that is what you
want,
You would need to instantiate application level events. See Chip Pearson's
site

http://www.cpearson.com/excel/appevent.com

--
Regards,
Tom Ogilvy

"Papa Jonah" wrote in message
...
I have been trying to get a file to remove a toolbar when the file is

closed.
Currently the toolbar is generated with code upon opening the file. This
works good.
But, I cannot figure out how to get it to delete when I close the file.
This is what I have at this point:

Private Sub App_WorkbookBeforeClose(ByVal Wb As Workbook, _
Cancel As Boolean)
Application.CommandBars("my toolbar").Delete
Cancel = False

End Sub

TIA



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 634
Default removing a toolbar with code

Hi Tom - better make that .htm instead of .com :-)

http://www.cpearson.com/excel/appevent.htm

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------
<snip


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 634
Default removing a toolbar with code

Hi Tom - better make that .htm instead of .com :-)

http://www.cpearson.com/excel/appevent.htm

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 148
Default removing a toolbar with code

A workbook level event would be fine with me, but I couldn't get it to work
so I settled for application level.

"Tom Ogilvy" wrote:

What you show is an application level event. Assuming that is what you
want,
You would need to instantiate application level events. See Chip Pearson's
site

http://www.cpearson.com/excel/appevent.com

--
Regards,
Tom Ogilvy

"Papa Jonah" wrote in message
...
I have been trying to get a file to remove a toolbar when the file is

closed.
Currently the toolbar is generated with code upon opening the file. This
works good.
But, I cannot figure out how to get it to delete when I close the file.
This is what I have at this point:

Private Sub App_WorkbookBeforeClose(ByVal Wb As Workbook, _
Cancel As Boolean)
Application.CommandBars("my toolbar").Delete
Cancel = False

End Sub

TIA




Reply
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
Removing check boxes (forms toolbar) jvs Excel Worksheet Functions 1 November 11th 09 04:23 PM
Having problem removing toolbar envelope. UBR362 Excel Discussion (Misc queries) 1 February 19th 07 02:48 PM
Removing custom toolbar from Excel 2003 [email protected] Excel Discussion (Misc queries) 0 July 14th 06 05:00 PM
Removing all code from a Project Stuart[_5_] Excel Programming 5 June 30th 04 12:54 AM
Removing a module with code KimberlyC Excel Programming 2 January 13th 04 09:51 PM


All times are GMT +1. The time now is 12:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"