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!).

image

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

image

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
           win.Close
        End If
    Next
    If
Visio.ActiveDocument.SolutionXMLElementExists("CustomPropertySets") Then
        Visio.ActiveDocument.DeleteSolutionXMLElement "CustomPropertySets"
    End If
    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
Dim
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
                evt.Delete
            End If
        End If
    Next
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.

    ramiro


Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

davecra.wordpress.com/

Microsoft Office Development, and more...

PowerShell.Amsterdam

Automate, Accelerate, Accurate

johnvisiomvp

Life with Visio and other Microsoft Toys!

Title (Required)

Windows Server Essentials Tips & Tricks

Nilsandrey's Weblog

Just another WordPress.com 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

Shapes, Stencils, Drawings Templates, Tutorials, Tips & Developer Info for Microsoft Visio

Hannes's Virtual Earth

Tips & Tricks around Mapping and Cloud Computing

Pluralsight blog

be smart, be clear, be visual ...

%d bloggers like this: