Hi, I have custom code that changes the color of workstation objects depending on their reserved status, which it reads from an external data source. What I need to do is have my "coloring code" run whenever the standard Data --> Refresh Data dialog is run from Visio at start up. Is there some way to have my code trigger after this dialog is run?
I wouldn't know of an event fired automatically after data refresh, but you write "at start up". Do you use the document_opened event? Then add to your already existing call for data refresh, a call to your coloring macro.
Secondly, it sounds weird to use a macro to color shapes. That's what smartshapes are for. Ie: you can set the color by means of formulas depending on values of the custom data.
Why, there seem to be an explicit event for this, Application.DataRecordsetChanged:
https://learn.microsoft.com/en-us/office/vba/api/visio.application.datarecordsetchanged
Thank you everyone. I will give these suggestions a try!