AfterRefresh Event

Started by lindir, April 16, 2014, 12:31:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lindir

Hello,
I'm creating a dynamic Visio diagram which is linked to a database. I set an automatic refresh of my datarecord sets every 5 minutes and I want to create an AfterRefresh Event to trigger several macro when the data are refresh.
After some googling I found this http://support.microsoft.com/kb/213187
but either it's not working or I didn't understand how to use it properly.. ???
I try to adapt it to Visio like this:

Dim WithEvents DataTRS As Visio.DataRecordset

Private Sub DataTRS_DataRecordsetChanged(ByVal DataRecordsetChanged As IVDataRecordsetChangedEvent)
MsgBox "Data Updated"
End Sub

Private Sub Document_RunModeEntered(ByVal Doc As IVDocument)

Set DataTRS = ThisDocument.DataRecordsets(1)

End Sub

But it doesn't work I think the event DataRecordsetChanged is not appropriate, anyone have an idea to create the AfterRefresh event or another method to trigger a macro after an automatic datasetrecord update???

Thanks for your answers guys
Alex

lindir

My previous code is working fine the procedure DataRecordChange take in account when data is refresh.. If it can help someone :)