Jump to content
Macro Express Forums

Help: A Macro runs fine for one user but the same macro doesn't quite work the same with another user.


Recommended Posts

Hello!

I am a creator of macros for my workplace, where a majority of the end users are work at home users. There is a macro that works fine for a vast majority of end users but for one, it behaves differently and it actually goes off and does something different. We have a major file where all the macros are housed and have a reloader that will update everyone's macros as needed so everyone should have the same file. I did double check with this member to make sure that everything is identical with what we have on file. I was able to execute this macro flawlessly so there was no issues on my end but this member instead of going to a particular screen, it just kind of sat on a particular screen, arrowed over to the left and right (I believe it was a save dialog box) and then just sat there and did nothing until it brings up a time out box, which I have set for 20 seconds. That was for a different issue but shouldn't be related as again no one else seems to be having this problem.

 

What makes this puzzling is that it doesn't do it all the time. It will work lines of data (Excel) without any problem and then suddenly a line will be a trouble spot. We skip that line and go onto the next line and it works until the next time it causes an issue. 

We all utilize virtual machines in order to run macros so that we can also have those run in the background so other tasks can be done during the day.

Is there something outside of coding that would cause for a macro to behave differently on one person's machine vs another person's? As we are all work at home, could an internet connection cause issues? I'd like to be able to explain this better as we seem to have this issue on a couple of members of the team. Thank you for any assistance anyone can provide. 

Link to comment
Share on other sites

There are dozens of ways user settings or environment can cause what you describe. Please don't be insulted but your message is like you calling an auto mechanic and asking what's wrong with you car with the only symptom being "it runs rough". 😁 There are many tricks like I used to automate the distribution of setting config files to all my users and they all worked off the same one. Some displays are at different resolution making the mouse moves WAY off target. Or one user auto-hiding their ribbon in Excel. There are some tricks like I always avoid mouse moves. I try to all of it with keyboard, even in web browsers. Home, a series of tabs, and so forth. But that's just one of many ways. And if you already use only keystrokes, then mouse move, ribbon states, and screen resolution will not be a factor. Also timing and flow control. I have no idea what you have implemented, but it becomes much more important in a multi-user environment. Some systems are more responsive, or as Samrae said Internet bandwidth or latency can be a problem if you're using a web browser. 

Link to comment
Share on other sites

If the macro is working with network files -- not on the PC itself -- then a slow internet connection certainly could cause problems. 

 

Since the problem is intermittent, based on your description I wonder if focus is being lost temporarily from the screen that the macro is working with.  This would potentially cause keystrokes to be "lost" -- that is, typed into some other application that has no use for them.  Once the macro gets out of sync with the application screen, random strange things will happen.  If you can pinpoint a specific spot where things go wrong, you could add macro instructions to check window focus at strategic times.  I have seen cases where an unexpected window "appeared" and disappeared so fast it never was visible to the user, but triggered some unrelated macro to run and caused major disruption. 

 

The same kind of problems could result from too-fast keystrokes outrunning the application. 

 

A technique I have used is to write log messages documenting the progress of the macro.  Then after a failure you can review the log and see where the proper sequence ended.  To reduce logging overhead, you could have another macro set some kind of switch (referenced by the problem macro) that turns logging on and off.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...