News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Recent posts

#21
User-submitted Stuff / Re: Find Complete Path: shapes...
Last post by joe.h - September 07, 2024, 04:21:14 PM
Quote from: Nikolay on September 04, 2024, 09:27:43 AMTo make sure undo works in one go, you can just wrap all operations between Application.BeginUndoScope and Application.EndUndoScope:

scope = Application.BeginUndoScope ("Highlight Shapes")

.... do a lot of things ...

Application.EndUndoScope(scope, True)



But I don't think this is needed for demo.

I got a syntax error so I looked here, https://learn.microsoft.com/en-us/office/vba/api/visio.application.endundoscope, the syntax below works. The method belongs in the Public sub (see below), if anyone else is interested.

Public Sub FindThePath()
scope = Application.BeginUndoScope("Highlight Shapes")
    Dim selShp As Visio.Shape
    Dim shpIDs() As Long
    Dim conIDs() As Long

    conClr = "RGB(255, 200, 0)"
    shpClr = "RGB(255, 255, 204)"
'    Debug.Print "conClr = ", conClr
'    Debug.Print "shpClr = ", shpClr
   
    Set selShp = ActiveWindow.Selection(1)
    If selShp.OneD Then            'If selected shape is 1D, then look for shapes
        Set conShp = selShp
        conShp.Cells("LineColor").Formula = conClr
        Call GluedShps(conShp)
    Else                            'Selected shape is 2D, look for connectors
        Set srcShp = selShp
        srcShp.Cells("LineColor").Formula = conClr
        srcShp.Cells("FillForegnd").Formula = shpClr
        Call GluedCons(srcShp)
    End If
Application.EndUndoScope scope, True
End Sub
#22
Visio Online, Cloud & SharePoint Issues / Layer selection via touchscree...
Last post by Noob - September 07, 2024, 08:30:34 AM
Hello everyone,

I am new here and new with Visio. The YouTube channel helped me a lot to get an overview of the possibilities of Visio. Big compliment to the channel. There's an idea that I don't know if it can be implemented. Maybe you have some advice?

I would like to show a building outline with all of our company's rooms and machines. In this floor plan, a layer should be created for each safety-related aspect. Among other things, a layer for all first aid facilities/boxes, a layer for all fire extinguishers, a layer for speed limit-areas, a layer for zones where PPE is mandatory, etc. - so far it will be no Problem, I guess.

Now the tricky part:
  • It would be great if this map could be displayed for visitors via a touchscreen in the foyer and visitors could select the individual layers via the touchscreen (or at least with provided mouse next to the screen).
  • I would also make the same file available to internal employees via Sharepoint so that they could easily select and view the layers.
  • To do this, all layers with names or symbols would have to be displayed somewhere above, below or next to the map (hyperlinks?). But different pages of this file should also be selectable, since I design each floor of the building on a new page.

Is this somehow possible in Visio 2013? Do I need Visio Professionel for this?

Thanks in advance and kind regards
Noob
#23
User-submitted Stuff / Re: Custom Ribbon with VBA in ...
Last post by Thomas Winkel - September 06, 2024, 03:58:08 PM
Good point. This is one of the most common reasons for us when the ribbon doesn't load.

Application.EventsEnabled is often used for performance tuning.
And if the script crashes, this property can remain FALSE.

Here error handling helps:

Sub ErrorHandlerDemo()
    Const SubName = "ErrorHandlerDemo"
    Dim scopeId As Long
    On Error GoTo ErrorHandler
   
    Application.ScreenUpdating = False
    Application.EventsEnabled = False
    Application.DeferRecalc = True
    scopeId = Application.BeginUndoScope(SubName)
   
   
    ' ---- Begin of your code
    Dim shp As Visio.Shape
   
    For Each shp In ActiveWindow.Selection
        shp.CellsU("Width").ResultIU = 1
        shp.CellsU("Height").ResultIU = 1
    Next shp
   
    'shp.CellsU("NotExistingField").ResultIU = 1 ' Simulate Error
    ' ---- End of your code
   
   
    Application.EndUndoScope scopeId, True
    Application.EventsEnabled = True
    Application.ScreenUpdating = True
    Exit Sub
   
ErrorHandler:
    Application.EndUndoScope scopeId, False
    Application.EventsEnabled = True
    Application.ScreenUpdating = True
    MsgBox Err.Description, vbInformation, SubName
End Sub
#24
User-submitted Stuff / Re: Custom Ribbon with VBA in ...
Last post by Surrogate - September 06, 2024, 09:55:24 AM
Quote from: bossi on January 02, 2023, 12:46:18 AMok , security Setting was on , had to either enable macros or better apply own certificate to it .
Make sure that this option is checked!

You can find it File -> Options -> Advanced -> General.

PS @Thomas Winkel, thank you for VisioTools.vss!
Quote from: Thomas Winkel on December 14, 2022, 02:37:32 PMI recommend to keep all code only in the stencil, not in documents.
It's easier to maintain code in a global stencil than hundreds of documents.
Absolutely
#25
Shapes & Templates / Re: Org Chart Template Help
Last post by Nikolay - September 05, 2024, 08:20:24 PM
"Shape protection, container, and/or layer properties prevent complete execution of this command" is a message you typically get if you try to break free from the protection that was set by shape developer to ensure shape consistency.

Org Chart shapes are supposed to be edited using Org Chart functions (available on the "Org Chart" tab)
#26
Shapes & Templates / Re: Org Chart Template Help
Last post by wapperdude - September 05, 2024, 05:53:22 PM
What comes to mind...
Open old Visio chart with your current version.  Save this using new file format, e.g. vsdx rather than vsd.  Close the new file.  Don't think you need to exit Visio.  Reopen the new file.  You ought to be able to arrange subordinates.
#27
Shapes & Templates / Org Chart Template Help
Last post by BeachDog2600 - September 05, 2024, 04:58:02 PM
Hello,

I'm currently using Microsoft® Visio® Plan 2 MSO (Version 2402 Build 16.0.17328.20550) 32-bit and have been encountering several issues. I would greatly appreciate any assistance from this community.

I'm working on an Org Chart and keep facing the following error: "Shape protection, container, and/or layer properties prevent complete execution of this command." Here's what I'm trying to achieve:

-Organizational Layout: I love the "Arrange Subordinates" function in the Org Chart template. However, I need a modification where employees directly reporting to a manager should be grouped into a single column. For example, if a manager has three direct reports and two supervisors, the chart currently creates five columns (one for each report and two for the supervisors). I'd like to combine the direct reports into a single column to save space.
-Shape and Text Box Adjustments: I want to be able to adjust the shapes and have the text boxes within them automatically resize to match the width of the shape (e.g., if the shape width is 2 inches, then the text boxes should also be 2 inches wide). Ideally, I'd like to define a new master setting so all new shapes adhere to these specifications.
-No Photos in Shapes: I want the shapes to exclude any photos.
-Multiple Employees in Shapes: I need to include multiple employees within a single shape. For instance, if three sales associates report to the same supervisor, their names should all appear within the shape, with the title at the bottom.
-Custom Color Palette: I would like to define and use a color palette that matches our company's brand colors.
-Division Titles: I want a shape at the top of each division to list the title of the division.

While I've managed to figure out some aspects on my own, I often encounter the "Shape protection, container, and/or layer properties prevent complete execution of this command" error. We currently have an Org Chart created in an older version of Visio (not using the Org Chart template), which is challenging to modify. If there's a way to integrate the "Arrange Subordinates" functionality into that chart, it might resolve many of our issues.

I'm not very familiar with macros, so if that's a potential solution, I'd need guidance on how to implement it.

Thank you so much for your time and assistance!
#28
User-submitted Stuff / Re: Find Complete Path: shapes...
Last post by wapperdude - September 04, 2024, 02:37:05 PM
Well, since I cannot verify the apparent problem, the proposed solution ought to solve the issue, but, I cannot demo it to be true.   

To misquote the Pakleds from Star trek TNG:  "Yacine and Nikolay are smart.  They make demo undo."
 ;D  ;D  ;D
#29
User-submitted Stuff / Re: Find Complete Path: shapes...
Last post by Nikolay - September 04, 2024, 09:27:43 AM
To make sure undo works in one go, you can just wrap all operations between Application.BeginUndoScope and Application.EndUndoScope:

scope = Application.BeginUndoScope ("Highlight Shapes")

.... do a lot of things ...

Application.EndUndoScope(scope, True)



But I don't think this is needed for demo.
#30
General Visio / Re: Visio Events Not Always Fi...
Last post by Yacine - September 04, 2024, 09:18:35 AM
Thomas has made a good point.
In my solution - also VBA based - in each routine that involves one on the main objects (vApp, vWin, Vpg, vDoc) I perform a fast "sanity" check: if not getVisioShort then ...

getVisioShort is a function returning a boolean.
It starts something like if not vPg is Nothing then return True,
Else try to re-initialize the variables: getVisio
if getVisio = true then getvisioshort is true
else = false.
Browser ID: smf (possibly_robot)
Templates: 2: index (default), Recent (default).
Sub templates: 6: init, html_above, body_above, recent, body_below, html_below.
Language files: 1: index+Modifications.english (default).
Style sheets: 2: index.css, responsive.css.
Hooks called: 175 (show)
Files included: 26 - 1002KB. (show)
Memory used: 920KB.
Tokens: post-login.
Cache hits: 9: 0.00100s for 22,972 bytes (show)
Cache misses: 4: (show)
Queries used: 12.

[Show Queries]