Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with Custom Tool Bar
I need some help please. I am using the following to build a custom tool bar.
This code is entered in the ThisWorkbook in the VBA editor; Sub SaveLoop() Do On Error Resume Next ActiveWorkbook.Save Loop Until ActiveWorkbook.Saved = True End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) Application.CommandBars("pscnt").Delete End Sub Private Sub Workbook_Open() ' Application.CommandBars.Add(Name:="pscnt").Visible = True Application.CommandBars("pscnt").Controls.Add Type:=msoControlSplitDropdown, _ ID:=128, Befo=1 Application.CommandBars("pscnt").Controls.Add Type:=msoControlSplitDropdown, _ ID:=129, Befo=2 Application.CommandBars("pscnt").Controls.Add Type:=msoControlButton, ID:= _ 21, Befo=3 Application.CommandBars("pscnt").Controls.Add Type:=msoControlButton, ID:= _ 19, Befo=4 Application.CommandBars("pscnt").Controls.Add Type:=msoControlButton, ID:= _ 22, Befo=5 Application.CommandBars("pscnt").Controls.Add Type:=msoControlButton, ID:= _ 108, Befo=6 Application.CommandBars("pscnt").Controls.Add Type:=msoControlComboBox, ID _ :=1733, Befo=7 Application.CommandBars("pscnt").Controls.Add Type:=msoControlButton, ID:= _ 2950, Befo=1 End Sub I want to be able to assign the SaveLoop code to the custom button I have included in the Workbook_Open part which builds the tool bar. How can I assign the SaveLoop code or include it in the build process so that when my users click the new "Save button", my SaveLoop code is invoked? Also, How can I attach an image that is available in the custom tool bar creation section? The purpose of the SaveLoop is to ensure the file saves while in a shared workbook state with multiple users saving at the same time. I found that it helps to prevent runtime save errors like "This file is currently locked by xxxx for saving". Instead of giving the error, the file just loops until it is free to save. FYI, this has worked great and is why I want to incorporate it to my custom tool bar. Any help or direction is greatly appreciated. -- Stephen |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Custom tool bar | Excel Discussion (Misc queries) | |||
Adding custom list and text boxes to the custom tool bar from Excel C API | Excel Discussion (Misc queries) | |||
Adding custom list and text boxes to the custom tool bar from Excel C API | Excel Programming | |||
AutoLoad Custom Tool Bar | Excel Programming | |||
Custom Tool buttons | Excel Programming |