Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DVS DVS is offline
external usenet poster
 
Posts: 2
Default deleting toolbars

Hi,

I need some help with how to manage the deletion of a custom toolbar
in Excel. I am creating the toolbar from the workbook when the
workbook is opened and deleting it when is closed.

The problem is that the user could create different workbooks from the
one I am distributing(utilizing save as) and have them open at the
same time. What I am notising is that when the user closes any of the
workbooks the toolbar dissappears form thr other opened workbooks
,however, I need the tool bar to be still displayed in each individual
workbook as the user could still be using it.

Any suggestion on how to make the toolbar stay for each opened file
that is a copy of the original workbook, without having to create an
add in?

thanks

dvs
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default deleting toolbars

I would suggest that a workbook only delete the toolbar if it is the only
workbook open created from your template. I think you could identify such
workbooks by a defined name that is present in them, but not likely in other
workbooks. For example:

Sub CloseToolBar()
Dim WB As Workbook
Dim NamesCounter As Integer
Dim Dummy As String
On Error GoTo NoName
For Each WB In Workbooks
Dummy = WB.Names("MyTemplateSpecialName").Value
NamesCounter = NamesCounter + 1
NextWB:
Next
If NamesCounter = 1 Then DoDeleteTB ''Only in this workbook
Exit Sub
NoName:
Resume NextWB
End Sub


--
Jim Rech
Excel MVP


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default deleting toolbars

I have solved similar problems, however, could use a
little more information. When you open numerous copies of
the workbook, do you get numerous toolbars? If no, why
not?

David Fixemer
  #4   Report Post  
Posted to microsoft.public.excel.programming
DVS DVS is offline
external usenet poster
 
Posts: 2
Default deleting toolbars

"david fixemer" wrote in message ...
I have solved similar problems, however, could use a
little more information. When you open numerous copies of
the workbook, do you get numerous toolbars? If no, why
not?

David Fixemer


If I open two different workbooks that were created form the same
template (or original workbook) with the same exact VBA code, there is
a toolbar for each window of excel (or opened workbook). If I comment
out the delete toolbar code, the toolbar on which window stays when
one of the other workbooks is closed. however, there is an empty
toolbar on any other file that I create or open afterwords if they are
not from the original tmeplate (workbook) that contained the code.

thanks

dvs
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
Deleting cell data without deleting formula Tom Hall Excel Discussion (Misc queries) 4 October 29th 06 04:07 PM
how prevent formula in cell from deleting when deleting value???? sh-boom New Users to Excel 1 September 30th 05 06:12 PM
Deleting Hyphens or Dashes from multiple cells without deleting the remaining content rmaloy Excel Programming 5 February 9th 04 01:59 AM
Adding/Deleting from toolbars using VBA Carsten[_2_] Excel Programming 3 December 8th 03 01:21 PM
Adding / Deleting from toolbars Steven Revell Excel Programming 4 September 24th 03 02:20 PM


All times are GMT +1. The time now is 09:26 AM.

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"