Closing Shape Data Sets window in Visio 2007

A colleague recently asked me how to close the Shape Data Sets window so that it does not automatically re-open when you open the drawing again.  My first thoughts was that this is surely a simple matter of saving the workspace, but it appears that this is not the case!  I found that other Visio users have had the same problem, so I thought I would present my solution (until Microsoft fix it!).


The window is opened from the right mouse menu of the Shape Data window.


The Shape Data Sets window has a right-mouse menu option to Close it, and it has the normal X button to close it.  Indeed, this does hide the window, but it automatically re-opens whenever the document is re-opened.

A little investigation reveals that the add-on; named "cpm" for Custom Property Management, I guess; creates two persistent events in the document, a SolutionXMElement, and User-defined cell.  So, I found it necessary to write a macro to remove all of these items from the document.

Public Sub CleanShapeDataSets()
Dim win As Visio.Window
    For Each win In Visio.ActiveWindow.Windows
        If win.Caption = "Shape Data Sets" Then
           win.Visible = False
        End If
Visio.ActiveDocument.SolutionXMLElementExists("CustomPropertySets") Then
        Visio.ActiveDocument.DeleteSolutionXMLElement "CustomPropertySets"
    End If
Visio.ActiveDocument.DocumentSheet.CellExists("User.CPMState", Visio.visExistsAnywhere) Then
        Visio.ActiveDocument.DocumentSheet.DeleteRow Visio.visSectionUser, Visio.ActiveDocument.DocumentSheet.Cells("User.CPMState").Row
    End If
evt As Visio.Event

Dim i As Integer
    For i = Visio.ActiveDocument.EventList.Count To 1 Step –1

        Set evt = Visio.ActiveDocument.EventList.Item(i)
        If evt.Persistent Then
            If evt.Target = "cpm" Then
            End If
        End If
End Sub

The macro can be stored in any Visio document, but just run it when you want to permanently close the Shape Data Sets window on the active document.

Posted in Visio. 1 Comment »

One Response to “Closing Shape Data Sets window in Visio 2007”

  1. Ramiro Garcia Says:

    I think I found another workaround for this problem. 1) Right-click on the shapes window and select the second-to-last menu item, “Close All Stencils”, with the right mouse button. 2) Again right-click in the shapes window, and select the last menu item, “Hide Window”. 3) Save your drawing.
    The next time you open it, you should be free of the annoying shapes window. I hope this helps.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.


O365 and SharePoint

Simplify Tasks

Want to learn the simple way?

Paul Turley's SQL Server BI Blog

sharing my experiences with the Microsoft data platform, SQL Server BI, Data Modeling, SSAS Design, Power Pivot, Power BI, SSRS Advanced Design, Power BI, Dashboards & Visualization since 2009

John Goldsmith's visLog

be smart, be clear, be visual ...

Mo's blog

Personal views on Dynamics 365 for Operations and Technical Architecture.

Chris Webb's BI Blog

Microsoft Power BI, Analysis Services, MDX, DAX, M, Power Pivot and Power Query

Azure Solutions for Office 365, and more...

Rob Fahrni



Life with Visio and other Microsoft Toys!

Nilsandrey's Weblog

Just another weblog

Things that Should be Easy

Every so often (too often in the IT industry) I encounter things that should have been very easy to do but turned out to be far too complicated. My favorite topics include SharePoint, .Net development, and software architecture, especially distributed systems.

Visio Guy

Smart graphics for visual people

%d bloggers like this: