I was shown a way to automate a macro using the following
script for excel:
'===============================================
Public PrevSize As Long
Const TargetFolder As String = "Program Files\Program.exe\Logs\"
Const SourceFile As String = "fileA.txt"
Const BlankFile As String = "blank.txt"
Sub MainCode()
Application.OnTime Time + TimeValue("00:00:15"), "CopyData"
'===============================================

This works fine,it does what is required with one exception.
The exception is the timer:
'============================================
Application.OnTime Time + TimeValue("00:00:15"), "CopyData"
'============================================

Every 15 seconds, the macro is activated. This was good for testing and developing the rest of the macro process.

But because the programs updated txt log files are random, it is best suited the macro is activated when the sound.wav file is sounded, in sync with the updated txt files.
Meaning, whenever the txt files are updated,to inform me of the update, a sound fille is sounded.

Is there a way the timer can be replaced so the macro is activated at the same time as the updated txt data instead of the current timer every 15 seconds ?

Much appreciated

petez