Macro Section Skipped

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have some fairly complicated macros set up. They work fine on my computer,
I have had no difficulty and use them with great success. However when put
in place on a co-workers computer they do not. I've already went through
line by line to make sure everything is identical, and when testing the
macros they worked fine at first. NOW, strange things are happening as
follows:

I have buttons set up in a spreadsheet that are linked to the macros. Click
button and voila you have everything set to go on it's own. The macro runs,
but skips the last part where it does a page setup and saves the file to a
destination determined by the macro. I placed a stop in the macro where it
skips and then play the macro to that point then step through the rest. It
works fine when I do that. So I'm confused as to why it would work fine
while stepping through, but not when you play it start to finish that is when
it skips that last section of the macro.

Any ideas??? Thanks in advance!!! :)
 
Maybe it has something to do with Application Events being disabled.
Try adding this to the beginning of your code.

Application.EnableEvents = True

Regards,
Paul
 
You probably have ON ERROR Resume Next statement in the code. The error
statement are masking the problems. I would put break points on error
statements in the code to find the problems. Usually these type problems
have to due with Permissions the co-workers have set up in their accounts.
 
Actually there aren't any ON ERROR RESUME NEXT sections in the macro, I
utilized If statements with GOTO line X kinds of things. It turned out to
be simpler that way for me. I narrowed it down in the macro what gets
skipped, and like I said when I put a stop there and run the macro to that
point then step through it NEVER errors. So I can't see what is happening if
it's working when I'm debugging it. It only skips the section when I play
macro from start to finish with no stops.

Also, my co-worker and I have the same permissions for everything, so I'm
still lost.

It just doesn't make sense *sigh*
 
Maybe it has to do with the speed of the different computers. I wrote a
program a few weeks ago that had multiple listboxes that the user had to
select. the program was only displaying 1 list box instead of three. It
turned out the program ran so quickly, it thought the mouse was still pressed
from the 1st list box when it got to the 2nd list box and continued without
giving the user an option to select from the 2nd list box. I had to add a
pause between the to list box selection to get the program to work.
 
I think that may have solved the issue. I placed a 5 second pause at that
point in the macro that it was skipping. I'll run some tests, but thus far
it is working on some of the macros that were having the difficulties.
THANKS!!!
 
If the part being skipped was the page setup, the delay will compensate for
the dialogue between the computer and external print device. That can happen
on a network device more often than a local printer. A five second delay
might be overkill, but if you don't have to worry about time, that's OK. A
one second delay would probably be sufficient.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top