PDA

View Full Version : Solved: Problem with amended xld.sheetmanager code



louww
06-13-2010, 01:49 PM
I've downloaded the xld.sheetmanager and it is an excellent utility.
Iv've tried customizing the code The problem I have now is the following:
I've tried to change the menu names in the .ply module and now I permanently have four hide/unhide names (old and new) when I right click on the sheet tabs. This also appears in other workbooks that does not have the code.

Any ideas how to fix?

Aussiebear
06-13-2010, 02:29 PM
Perhaps if you just move your head a little to the right we can then all read the code that you have "modified"

A little far fetched perhaps, but how do you expect us to assist you if we cannot view your amendments?

Bob Phillips
06-13-2010, 03:05 PM
The menu options will always be there as long as the code workbook is open .

Which bits of the code did you change?

Bob Phillips
06-13-2010, 03:08 PM
Thinking about it, you probably renamed the controls after the old name had been created, and the delet then deletes the new name.

In the VBIDE immediate window, enter

application.CommandBars("Ply").controls("Hide Sheet(s)")

and

application.CommandBars("Ply").controls("Unhide Sheet(s)")

louww
06-14-2010, 12:37 AM
The changes I made are listed below.
All I wanted to do is change the names in the tab menu, and now I have the new and old names in the relevant workbook and all other workbooks (even if the original is closed).
MenuRemovePly

With Application.CommandBars("Ply")
.Controls.Add(Type:=msoControlButton).Caption = _
"Hide Check List(s)"
.Controls.Add(Type:=msoControlButton).Caption = _
"Unhide Check List(s)..."
.Controls("Hide Check List(s)").BeginGroup = True
.Controls("Hide Check List(s)").OnAction = "HideSheet"
.Controls("Unhide Check List(s)...").OnAction = "UnhideSheet"
End With
End Sub

'-------------------------------------------------
' Function: Removes the two items from the Ply
' menu
'-------------------------------------------------
Public Sub MenuRemovePly()
On Error Resume Next
With Application.CommandBars("Ply")
.Controls("Hide Check List(s)").Delete
.Controls("Unhide Check List(s)").Delete
End With
On Error GoTo 0
End Sub

Bob Phillips
06-14-2010, 12:41 AM
Did you try what I suggested in my follow-up post? Your response suggests that I correctly predicted the problem.

louww
06-14-2010, 01:01 AM
Works perfectly, thanks!