I've got two macros that can show or hide a certain layer on a page, but it doesn't want to work on different pages in the same file. The Debug is highlighting the Item # as the issue. I've renamed the layer "1-Valve Lineup" so that it's the top layer on all pages, but that doesn't fix the issue.
Sub HideVL()
'Enable diagram services
Dim DiagramServices As Integer
DiagramServices = ActiveDocument.DiagramServicesEnabled
ActiveDocument.DiagramServicesEnabled = visServiceVersion140 + visServiceVersion150
Dim UndoScopeID1 As Long
UndoScopeID1 = Application.BeginUndoScope("Layer Properties")
Dim vsoLayer1 As Visio.Layer
Set vsoLayer1 = Application.ActiveWindow.Page.Layers.Item(7)
vsoLayer1.CellsC(visLayerVisible).FormulaU = "0"
vsoLayer1.CellsC(visLayerPrint).FormulaU = "0"
Application.EndUndoScope UndoScopeID1, True
'Restore diagram services
ActiveDocument.DiagramServicesEnabled = DiagramServices