When Mach loads a program it reads the code to draw the toolpath, any M codes you have created are also read, what you have to do is this :-
enter this code into each and every macro you have created:
If IsLoading() Then
' program loading, do nowt
Else
' enter your existing code lines here
End If
This will stop mach3 executing the code during loading
Graham.