Visio Layers and Checkboxes

Поділитися
Вставка

КОМЕНТАРІ • 45

  • @harshadjadhav3282
    @harshadjadhav3282 Рік тому +1

    Loved it. Made my day. Thanks 🙂

  • @PuppiesPuppies
    @PuppiesPuppies 3 роки тому +2

    It’s as if Timothy Dalton (James Bond) were teaching Visio! Nice work sir!

  • @freezerlunik
    @freezerlunik 4 роки тому +1

    Very well done! Thank you for this concise and action-packed tutorial!

  • @andystokes8222
    @andystokes8222 5 років тому +1

    Great tutorial - very useful for complex network diagrams!

  • @lorenzofabbri440
    @lorenzofabbri440 3 роки тому +1

    Thanks a lot, done and working really well 👍

  • @AndrewWest13
    @AndrewWest13 6 років тому

    Easy to follow, gets the job done. Looking forward to more as this was a much simpler approach then a previous button type approach I used. Thank you.

  • @MsBettyRubble
    @MsBettyRubble 6 років тому +1

    So helpful, and just what I needed! Thanks for sharing this. I've created a complicated network diagram. This is perfect for isolating how data moves through the system.

    • @JPL2thousand9
      @JPL2thousand9 5 років тому

      Same here. I'm needing to separate backhaul on my network map without having to jump back and forth between different maps. Would like an easier solution but this will definitely help.

  • @jenswachholz8279
    @jenswachholz8279 Рік тому +1

    Very good - thank you. Do you have a short demo with radio buttons too? How to group them and to get the status back?

    • @10mins
      @10mins  Рік тому

      Jens. Sorry but I do not have anything on radio buttons. My Visio videos were created several years ago. I have since retired and have not touched Visio since then, so I'm afraid there's nothing new in the pipeline.

  • @ZSDust
    @ZSDust 2 роки тому +1

    Owe you a big thank you!

  • @Inkoknyto
    @Inkoknyto Місяць тому +1

    Wonderfull, this is exactly what I was looking for. Thank you!
    Can you ore someone maybe post the macro-codes here? I couldn't read the writing because it was very blurry on my screen.

    • @10mins
      @10mins  Місяць тому +1

      Sub LayerToggle(ItemNbr As Integer, OnOff As String)
      'Enable diagram services
      Dim DiagramServices As Integer
      DiagramServices = ActiveDocument.DiagramServicesEnabled
      ActiveDocument.DiagramServicesEnabled = visServiceVersion140
      Dim UndoScopeID1 As Long
      UndoScopeID1 = Application.BeginUndoScope("Layer Properties")
      Dim vsoLayer1 As Visio.Layer
      Set vsoLayer1 = Application.ActiveWindow.Page.Layers.Item(ItemNbr)
      vsoLayer1.CellsC(visLayerVisible).FormulaU = OnOff
      Application.EndUndoScope UndoScopeID1, True
      'Restore diagram services
      ActiveDocument.DiagramServicesEnabled = DiagramServices
      End Sub

    • @Inkoknyto
      @Inkoknyto Місяць тому

      @@10mins Thank you! Very kind :)

    • @10mins
      @10mins  Місяць тому

      @@Inkoknyto You are welcome.

  • @bobbycalabrese831
    @bobbycalabrese831 6 років тому

    Great Training Video! Well Planned out, good voice. Thanks for sharing

  • @AbhishekChauhan-ux8gg
    @AbhishekChauhan-ux8gg 4 роки тому +1

    Thank You, save my day !

    • @10mins
      @10mins  4 роки тому

      I'm glad I could help.

  • @jizengjin4021
    @jizengjin4021 6 років тому +1

    That was very helpful. Thank you!

  • @yannicky2588
    @yannicky2588 6 років тому

    Great video, Great spirit! Thank you very much.

  • @tmanoharanify
    @tmanoharanify 3 роки тому

    thank you for the video. I am getting run time error, i follow all your steps. any advise?

    • @10mins
      @10mins  3 роки тому +1

      If you look in the comments below, about 1 year ago Barnaby Arnott posted some suggestions for improvements. You might try incorporating his suggestions. In the replies to Barnaby's post, Saber Dokmak posted that he was experiencing a run time error, but he later updated to say the problem was "the caption wasn't the same".

    • @tmanoharanify
      @tmanoharanify 3 роки тому

      @@10mins thank you I just tried again using your instructions and it worked for me! I may have done something wrong last time :). Thank you!!!

    • @10mins
      @10mins  3 роки тому +1

      @@tmanoharanify I'm pleased to hear you resolved your problem.

  • @vorapobautomation9760
    @vorapobautomation9760 9 місяців тому

    How to display the object or shape name in text by just only click at the shape ?

  • @jmorton128
    @jmorton128 7 років тому

    This was awesome. I had to tweak mine by adding a .Value before the Then statement. One thing though, I've created a second tab called 'option 2' this tab has some of the same objects and flows as my first tab 'option 1' I'm trying to create another macro to use some of the same 'check boxes' but can't seem to create another macro. I tried using the same macro and Visio Objects (Private Sub) and just add my new IF statements to the new flows but that doesn't seem to work. Any chance you could point me to some documentation on doing what you did in this video but across multiple tabs? Or say adding a 3rd shape but on a different tab and adding an additional check box on tab 2? Either way, this was grrreat! Thanks!!

    • @10mins
      @10mins  7 років тому

      Thanks for watching, and for leaving a comment. I'm glad you found it useful. I hadn't thought about trying to do it across multiple layers, but now you've planted that idea I will play around and see what I can come up with. Stay tuned, but don't hold your breath because it might be a while before I can get around to it.

  • @matrout61
    @matrout61 5 років тому

    I found that the layers changes the box fill color and text to the layer color assigned. Is there a way to have it only change the fill color but keep the text black?

    • @10mins
      @10mins  5 років тому

      Mark, you should be able to add code to set the color of the text. If, like me, you're not a VBA coder, then you could use the same technique I used to figure out what the code looks like. Create a macro and use Visio to change the text color, and then go into the macro editor to examine your code. In principal you should be able to change any of the properties of the object in the module when you toggle a layer on or off.

  • @MrBarnabyArnott
    @MrBarnabyArnott 4 роки тому +2

    Just what I was looking for! :)
    Let me suggest some improvements to fill the gaps you admitted to:
    Just pass the Checkbox's 'Value' property to avoid the If statement
    And if you set the Caption to match the layer's name, you can just pass that. Substitute "##" below with your layer name. (If you don't like this, maybe look at using the Data1 or GroupName properties of the Checkbox to populate the related layer's name)
    Private Sub ToggleLayer_##_Click()
    Call LayerToggle(ToggleLayer_##.Caption, ToggleLayer_##.Value)
    End Sub
    Sub LayerToggle(LayerName As String, Checked As String)
    ' Used by checkboxes to toggle visible layers
    'Enable diagram services
    Dim DiagramServices As Integer
    DiagramServices = ActiveDocument.DiagramServicesEnabled
    ActiveDocument.DiagramServicesEnabled = visServiceVersion140 + visServiceVersion150
    Dim UndoScopeID1 As Long
    UndoScopeID1 = Application.BeginUndoScope("Layer Properties")
    Dim vsoLayerToToggle As Visio.Layer
    Set vsoLayerToToggle = Application.ActiveWindow.Page.Layers.Item(LayerName)
    vsoLayerToToggle.CellsC(visLayerVisible).FormulaU = Checked
    Application.EndUndoScope UndoScopeID1, True
    'Restore diagram services
    ActiveDocument.DiagramServicesEnabled = DiagramServices
    End Sub

    • @10mins
      @10mins  4 роки тому +1

      Thank you for your input Barnaby. That's very helpful. I appreciate you taking the time to spell it out.

    • @sdolo222
      @sdolo222 4 роки тому

      Doesn't really work for me, it says runtime error. .Item() seems to only read integers. Would be cool to get your code working though but I'll stick to the original code in the vid for now. Thank you both so much and appreciate any further help :)
      **UPDATE**: I managed to fix my issue, the caption wasn't the same, now it works!

  • @mc_fat_ed542
    @mc_fat_ed542 Рік тому

    I want to do this in Actions, can you assist with that?

    • @10mins
      @10mins  Рік тому

      I afraid I can't help, I'm not even sure what you mean by Actions. I created this video several years ago when I was still working regularly with Visio. I've been retired for a while, and I haven't touched it since then, so I'm rather out of touch now.

  • @RhythMickJ
    @RhythMickJ 4 роки тому

    The layer can be accessed by name for example ...
    Set vsoLayer = ActivePage.Layers.Item("LayerName")

    • @10mins
      @10mins  4 роки тому +2

      Thanks for that Mick. Good to know. I assumed there must be a way, but as I said in the video, I'm just feeling my way around. I'm definitely not a VBA coder.

  • @londonengland2309
    @londonengland2309 3 роки тому

    How is this going to help if you have 200 layers? All these lines of coding?

    • @10mins
      @10mins  3 роки тому

      I'm sorry but I can't tell if your post is intended to be a genuine question or a criticism. In either case, I agree with you that it would be a pain to do it this way for a large number of layers.
      If it's a question, then I would add, "I do say somewhere in the video that I'm not a VBA programmer. I'm just a guy who found a way to do something neat and wanted to share it. If it doesn't work for you, that's a pity, but judging by some of the comments I've received, other people have found it useful, therefore I feel it was worthwhile publishing it.
      If it's a criticism... Fair point. Constructive criticism is always welcome. How would you suggest it should be done?

  • @COii3153
    @COii3153 7 років тому

    Appreciate your time sharing this +1

  • @cdallen6483
    @cdallen6483 6 років тому

    Is there a limit on the number of instances in which you can do this? I've had success replicating your techniques to apply 6 different layers onto 2 different pages within Visio 2016. However, once I apply them to a third or fourth page(tab), the entire process ceases to be applicable. The coding appears to be the same from page 2 to page 3, but it's just like the formula just doesn't work anymore. Scratching my head here. Any thoughts on the matter that you could possibly assist me with? Anyone?

    • @10mins
      @10mins  6 років тому

      I've never tried doing it on multiple pages, so I'm afraid I don't have a ready answer. About a year ago, another viewer (J Morton) reported a similar problem. I intended to investigate further, but never got around to it. (My schedule has been rather full for a long while.)
      Perhaps someone else has an answer???

    • @cdallen6483
      @cdallen6483 6 років тому

      After playing around with it a bit further, I was able to find a work around. Visio 2016 has enough bugs as it is already, but I proceeded under the notion that the macros themselves may have had a limit to the number of shapes utilizing their individual coding. I ended up creating multiple macros to accommodate the many shapes and layers as opposed to simply relying on just the one. Seems to work well at this point.

    • @10mins
      @10mins  6 років тому

      Interesting. I've never stress tested any of the macros I've built, so I wasn't aware of this limitation. Thanks for sharing your findings.

  • @donnyyeo
    @donnyyeo 5 років тому

    Audio is too low. Normalize the audio first before uploading to UA-cam.

    • @10mins
      @10mins  5 років тому

      That's strange because it comes across loud and clear when I play it back. Tried it on the laptop on which I created it, a different laptop, and on my phone. All sounds good to me.