Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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
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
Custom tool bar Mikesee Excel Discussion (Misc queries) 2 March 19th 08 09:24 PM
Adding custom list and text boxes to the custom tool bar from Excel C API Mousam Excel Discussion (Misc queries) 0 August 7th 07 09:19 AM
Adding custom list and text boxes to the custom tool bar from Excel C API Mousam Excel Programming 0 August 6th 07 10:05 AM
AutoLoad Custom Tool Bar Jim Carter Excel Programming 3 August 16th 04 11:32 PM
Custom Tool buttons Mark G. Excel Programming 1 September 26th 03 11:49 AM


All times are GMT +1. The time now is 06:55 PM.

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

About Us

"It's about Microsoft Excel"