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
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.
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
Sandy says
Thank you Ramiro!!!! After hours of reading things and trying things, your fix worked!!!