Hi All
Apologies if this is the incorrect forum
I am creating layers within my diagram with no problems, what i can't seem to get functioning is that i have multiple toggle buttons to the layers to display them. What happens is i want to view button 3 layer but this wont display unless i view button 1 and 2
Is there something i am doing wrong here? I am pretty new to this and have very basic VBA code. The code i am using is: -
Private Sub ToggleButton1_Click()
Dim LayersObj As Visio.Layers
Dim LayerObj As Visio.Layer
Dim LayerName As String
Dim LayerCellObj As Visio.Cell
Set LayersObj = ActivePage.Layers
For Each LayerObj In LayersObj
LayerName = LayerObj.Name
If LayerName = "Layer1" Then
Set LayerCellObj = LayerObj.CellsC(visLayerVisible)
If ToggleButton1.Value Then
LayerCellObj.Formula = True Or 1
Else
LayerCellObj.Formula = False Or 0
End If
End If
Next
End Sub
In addition, what would be good would also be able to have a button to toggle all on/off (display/hide) the layers
Thanks