title: Programming a command button in Visio 2013 using VBA to open the layer properties window
body: <p>This is an issue I have been trying to solve for some time now. I do not know VBA, I am still trying to learn. I have diagrams I created for work in Visio 2013 and the diagrams use layers. I am trying to code in a command button to open up the layer properties window for the active page the user clicks the button on. I have perused through the Microsoft documentations page for Visio but I cannot find out how to reference the layer properties window as an object and how to run it using VBA. This is what I have tried so far with different iterations;</p>
  
  <pre><code>Private Sub CommandButton1_Click()
  Visio.Page.Layers.Properties("NameofPage").Run 
  End Sub
  </code></pre>
  
  <p>I truly appreciate any help and guidance on this matter. I am not even sure what I am doing wrong. </p>