• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

bVisual

  • Home
  • Services
    • How Visio smartness can help your business
    • Visio visual in Power BI
    • Visio Consulting Services
    • Visio Bureau Services
    • Visio Training and Support Services
  • Products
    • Visio Shape Report Converter
    • SS Plus
    • LayerManager
    • visViewer
    • Metro Icons
    • Rules Tools for Visio
    • The Visio 2010 Sessions App
    • Multi-Language Text for Visio
    • Document Imager for Visio
    • multiSelect for Visio
    • pdSelect for Visio
  • Case Studies
    • Case studies overview
    • Using Visio in Education for GIS
    • Visualizing Construction Project Schedules
    • Visio Online Business Process Mapping
    • Nexans Visio Template
    • CNEE Projects, WorldCom
    • Chase Manhattan Bank
  • News
    • Recent news
    • News archive
  • Resources
    • Articles➡
      • ShapeSheet Functions A-Z
      • Comparing Visio for the Web and Desktop
      • Customising Visio Shapes for the Web App
      • Key differences between the Visio desktop and web apps
      • Using the Visio Data Visualizer in Excel
      • Using Visio in Teams
      • Creating Visio Tabs and Apps for Teams with SharePoint Framework (SPFx)
      • Designing Power Automate Flows with Microsoft Visio
      • Innovative uses of Visio Lists
    • Webcasts ➡
      • Visio in Organizations
      • My session and other Visio sessions at MSIgnite 2019
      • Power up your Visio diagrams
      • Vision up your Visio diagrams
      • The Visio 2010 MVP Sessions
    • Visio Web Learning Resources
    • Books➡
      • Visualize Complex Processes with Microsoft Visio
      • Mastering Data Visualization with Microsoft Visio
      • Microsoft Visio Business Process Diagramming and Validation
      • Visualizing Information with Microsoft Visio
  • Blog
    • Browse blog articles
    • Visio Power BI articles
    • Visio for Web articles
    • A history of messaging and encryption
  • About us
    • About bVisual
    • Testimonials
    • Bio of David Parker
    • Contact Us
    • Website Privacy Policy
    • Website terms and conditions
    • Ariba Network
You are here: Home / Coding / How SVG in Visio can cause a Shape.BoundingBox(…) error

Published on November 10, 2025 by David Parker

How SVG in Visio can cause a Shape.BoundingBox(…) error

I have used Visio’s Shape.BoundingBox(…) for many, many years and I cannot ever recall it failing, but I have now managed to create some shapes that cause it to error. This caused many hours of confusion, so I nearly abandoned using the method, until I discussed it with my fellow Visio MVP, John Goldsmith (see VisualSignals), and together we examined the cause. It came down to a badly formed sub-shape within the shape that had zero dimension … and in fact had an incomplete ShapeSheet. If you look at the screenshot below, then you may notice that there is no Shape Transform section! That is a mandatory section, and should always exist … so how did this happen?

A colleague\client on one of my projects designs hundreds of shapes in Visio which I save into Xml files so that they can be maintained, searched and re-called easily within the VSTO add-in. Some of these shapes are saved as SVG using the Shape.Export() method, then the SVG text is saved into the Xml. A single master shape is dropped, and the contents updated from the SVG in the Xml. Later, the Shape.Import(…) method is used add the SVG graphics to an existing shape after the SVG text has been extracted from the XML file.

The following screenshot is of the ShapeSheet of the hidden sub-shape in the simple square shape, and of the exported SVG, where it can be seen that the group shape with the id=”shape111713-2” does not have any geometry, thus resulting in the malformed ShapeSheet above.:

  • Original Hidden Shape ShapeSheet
  • Malformed SVG ?

Of course, I have asked why those hidden shapes exist in the first place, but my work-around is to automatically remove these error causing sub-shapes after the SVG has been imported:

public static void TraverseAndRemoveEmptySubShapes(Visio.Shape shape)
{
    //return;
    if (shape == null || shape.Shapes.Count == 0)
        return;

    foreach (Visio.Shape subShape in shape.Shapes)
    {
        if (subShape.RowExists[(short)Visio.VisSectionIndices.visSectionObject, (short)Visio.VisRowIndices.visRowXFormOut, (short)Visio.VisExistsFlags.visExistsAnywhere] == 0)
        {
            subShape.Delete();
        }
        else
        {
            // Recursively traverse its sub-shapes
            TraverseAndRemoveEmptySubShapes(subShape);
        }
    }
}

It would be good if Visio automatically inserted the mandatory sections from the SVG so the problem did not arise in the first place. I do know of at least one other project that I have work on where zero size sub-shapes are inserted purposefully. These particular sub-shapes are there to hold data only. Hopefully, they never export to SVG and back into Visio shapes!

Relevant articles

Post-Processing Paste from Clipboard in Visio

One of my current Visio VSTO add-in projects requires me to react to users pasting custom shapes in the Visio page from the clipboard. The process involves registering the ExitScope event and then checking the Clipboard contents. Initially, I was merely testing for a line in the DataObject that started with the word “Visio “,…

Optimize Visio Flowcharts: Swimlane Reordering Tips

Microsoft Visio desktop Plan 2 and Professional editions provides the ability to create and synchronize cross-functional flowcharts between the diagram and an Excel table. This is great, and widely used for many types of processes. The Excel table normally has a Function / Swimlane column that contains text that becomes labels on the swimlane containers,…

Refreshing the cached installed files of Visio

I have created many Visio solutions over the past 25 years and used a number of methods of creating an installation that includes Visio templates and stencils. I have just wasted many hours trying to debug an installation created with Advanced Installer until I realised that the problem was that Visio was not properly updating…

Linking Data to Shapes in Visio after using Data Visualizer

Data Visualizer (DV) in Visio Plan 2 (Data | Create from Data | Create ) is great because it provides a way of automatically creating a diagram from data, but it also prevents some of the other data-linking features in Visio from being used. This is because DV wants to take control of the data…

New Requirement for VBA Digital Signatures in Visio

Like most developers, I have to buy a new digital certificate every 3 years to sign my Visio add-ins and VBA projects. Usually that means verifying my bone fides, paying the fee and downloading the certificate, but security has been increased, and now, like everyone else, I have to use a USB key with it…

Using Visio Color by Value on Connectors

Data Graphics in Visio Plan 2 and Visio Professional is great, but it only enables us to use them with 2D shapes in Visio, i.e. not on connectors. So, what if you want to change the line colour of the connectors between the 2D shapes because of the data flowing between them? Well, it is…

Related

Filed Under: C#, Coding, eVSM Mix, ShapeSheet Formulas, Visio Tagged With: Coding, ShapeSheet, SVG, Visio

About David Parker

David Parker has 30 years' experience of providing data visualization solutions to companies around the globe. He is a Microsoft MVP and Visio expert.

Primary Sidebar

  • LinkedIn
  • Twitter

Recent Posts

  • How SVG in Visio can cause a Shape.BoundingBox(…) error
  • Post-Processing Paste from Clipboard in Visio
  • Are Master Shortcuts useful in Visio?
  • Jumping between Shapes in Visio
  • Co-authoring and Commenting with Visio Documents

Categories

Tags

Accessibility Add-Ins Connectors Containers Data Export Data Graphics Data Import Data Visualizer Educational Excel GraphDatabase Hyperlinks Icon Sets JavaScript LayerManager Layers Legend Link Data to Shapes Lists MSIgnite MVP Office365 Org Chart PowerApps PowerBI PowerQuery Processes Shape Data Shape Design ShapeSheet ShapeSheet Functions SharePoint 2013 SQL Teams Validation VBA Video Visio Visio 2007 Visio for the desktop Visio for the Web Visio Online Visio Services Visio Viewer Webinar

Footer

bVisual Profile

The UK-based independent Visio consultancy with a worldwide reach. We have over 25 years experience of providing data visualization solutions to companies around the globe.

Learn more about bVisual

  • Amazon
  • E-mail
  • Facebook
  • LinkedIn
  • Twitter
  • YouTube

Search this website

Recent posts

  • How SVG in Visio can cause a Shape.BoundingBox(…) error
  • Post-Processing Paste from Clipboard in Visio
  • Are Master Shortcuts useful in Visio?
  • Jumping between Shapes in Visio
  • Co-authoring and Commenting with Visio Documents

Copyright © 2025 · Executive Pro on Genesis Framework · WordPress · Log in