Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Add Toolbar to workbook

Hi There,

I have added a Toolbar ("Sige") to a workbook.

How to make this toolbar visible on opening and remove it on closing
the workbook.

Keeping all the present Toolbars!

Brgds Sige

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Add Toolbar to workbook


Use this to call your bar and assign macros to the buttons on it and th
one below to remove toolbar!

Sub Auto_Open()
With Application
.CommandBars("YOUR BAR NAME").Visible = True
.CommandBars("YOUR BAR NAME").Controls("BUTTON NAME").OnActio
= "MACRO NAME"
.CommandBars("YOUR BAR NAME").Controls("BUTTON NAME").OnActio
= "MACRO NAME"
.DisplayFullScreen = False
End With
End Sub

Sub cleanupmenubar()
On Error Resume Next
Application.CommandBars("YOUR BAR NAME").Controls.Delete
On Error GoTo 0

End Sub

Untested but should work!

Hope this helps!

Simo

--
Simon Lloy
-----------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670
View this thread: http://www.excelforum.com/showthread.php?threadid=47169

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Add Toolbar to workbook

Hi Simon,

The Loading goes fine ...but the "cleanupmenubar" returns Error:
"Method or data member not found" on ".Delete"

This works though:
Application.CommandBars("UpdateReportName").Visibl e = False

Thx, Sige


Sub Auto_Open()
With Application
..CommandBars("UpdateReportName").Visible = True
..CommandBars("UpdateReportName").Controls("&Excha nge
Folder...").OnAction = "ShowDialog"
'.CommandBars("UpdateReportName").Controls("&Excha nge
Folder...").OnAction = "MACRO NAME"
..DisplayFullScreen = False
End With
End Sub


Sub cleanupmenubar()
On Error Resume Next
Application.CommandBars("UpdateReportName").Contro ls.Delete

On Error GoTo 0
End Sub

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
Toolbar for a specific workbook Prixton Excel Worksheet Functions 1 February 24th 07 02:19 PM
Attaching a toolbar to a workbook Prixton Excel Discussion (Misc queries) 1 February 24th 07 01:44 PM
Toolbar for a specific workbook Prixton Excel Discussion (Misc queries) 8 February 23rd 07 04:44 PM
Toolbar on opening a workbook Tom Ogilvy Excel Programming 0 August 26th 04 03:00 PM
Workbook-specific toolbar possible? FMcC Excel Programming 1 May 19th 04 09:26 AM


All times are GMT +1. The time now is 10:32 AM.

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"