rokuk
11-11-2008, 10:14 AM
Hi there.
I have a visio 2007 application I inherited, the previous people had used most the macro recorder to meet their custom VBA needs. I am trying to understand the auto-code here, but am having trouble debugging something. This related to hiding certain shapes in a specific layer that will not go away.
On the sheet, there is a "Show Menu" button. If it is double-clicked it runs a function to pop up several new menu buttons (when those menu buttons are clicked, they run other custom functions). This all works fine.
When the "Show Menu" button is clicked a second time, it is supposed to hide the menu buttons that have popped up. This partially works - it will hide any of those menu buttons that were NOT used, but any of them that were used will continue to stay visible - and I can not figure out why!!
This is how the VBA code is currently written for toggling the menu buttons on and off (in the "Show Menu" button function). I understand the general gist of how it works, but I must be missing something.
Set vsoLayer1 = Application.ActiveWindow.Page.Layers.Item("myMenuButtons")
If vsoLayer1.CellsC(visLayerVisible).FormulaU = "0"
Then vsoLayer1.CellsC(visLayerVisible).FormulaU = "1"
Endif
If vsoLayer1.CellsC(visLayerVisible).FormulaU = "1"
Then vsoLayer1.CellsC(visLayerVisible).FormulaU = "0"
Endif
The only thing I can think of is that when the menu buttons are clicked they are being taken out of their layer, or locked from being modified or something somehow. I know there is code for each menu button as well that is not posted here, but it didn't seem like it would affect their visibility... I mean they should still be part of the layer, right? I can try to post that too if anyone thinks it would be helpful...
Any thoughts?
Thank you!!
I have a visio 2007 application I inherited, the previous people had used most the macro recorder to meet their custom VBA needs. I am trying to understand the auto-code here, but am having trouble debugging something. This related to hiding certain shapes in a specific layer that will not go away.
On the sheet, there is a "Show Menu" button. If it is double-clicked it runs a function to pop up several new menu buttons (when those menu buttons are clicked, they run other custom functions). This all works fine.
When the "Show Menu" button is clicked a second time, it is supposed to hide the menu buttons that have popped up. This partially works - it will hide any of those menu buttons that were NOT used, but any of them that were used will continue to stay visible - and I can not figure out why!!
This is how the VBA code is currently written for toggling the menu buttons on and off (in the "Show Menu" button function). I understand the general gist of how it works, but I must be missing something.
Set vsoLayer1 = Application.ActiveWindow.Page.Layers.Item("myMenuButtons")
If vsoLayer1.CellsC(visLayerVisible).FormulaU = "0"
Then vsoLayer1.CellsC(visLayerVisible).FormulaU = "1"
Endif
If vsoLayer1.CellsC(visLayerVisible).FormulaU = "1"
Then vsoLayer1.CellsC(visLayerVisible).FormulaU = "0"
Endif
The only thing I can think of is that when the menu buttons are clicked they are being taken out of their layer, or locked from being modified or something somehow. I know there is code for each menu button as well that is not posted here, but it didn't seem like it would affect their visibility... I mean they should still be part of the layer, right? I can try to post that too if anyone thinks it would be helpful...
Any thoughts?
Thank you!!