Trigerr a macro every minutes

Started by lindir, May 13, 2015, 01:58:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lindir

Hi guys!

I need to trigger a macro every minute. Anybody has an idea to do that?

I don't know which function or which events I can use.

Thanks in advance.

JohnGoldsmith

#1
You could have a look at the NOW() function (which fires every minute).

Maybe something like this in a Doc user cell (or some other central place):


User.MyTimerCell = NOW()+CALLTHIS("ThisDocument.MyProc")


Otherwise there are other code based timer methods that might be of interest:
Hope that helps.

Best regards

John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

lindir

Thank for your response JohnGoldsmith
In the document shapesheet in the user defined cells section, I insert a row with the foloing formulate
= NOW()+CALLTHIS("ThisDocument.MyProc")


And then in  the macro editor in Thisdocuments I wrote this code:
Sub MyProc()

MsgBox "I'm triggered at " & Now()

End Sub


But saldy nothing happend :(

JohnGoldsmith

Hi,

You need to make sure you include a reference to the incoming shape (in this case 'TheDoc') in your procedure's arguements.  For example:

Public Sub MyProc(ByRef shpIn As Visio.Shape)
    MsgBox "I'm triggered at " & Now()
End Sub


Let me know if that works for you.

Best regards

John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

lindir

Work with the reference.

Thank you very much :)