Recorded Macro Works, Code Doesn't

J

Jay

Hello all,

This is an question that I can't solve, but it's not a terribly important
issue.

I've been tasked to rewrite some macros that various users have recorded.
It's fairly straightforward and I don't have any problems. But there's two
lines of code that are all over the macro, and I can't figure out how they
were recorded. If I remove those two lines and try to run them
independently, it crashes. I'm wondering if I'm missing something, thought
I'd throw it out there. Again, this is just to satify my curiousity.

The lines are:
ActiveWindow.Visible = False
ActiveWindow.Activate

These two lines appear maybe 5 times per macro. But the user doesn't know
what they did, and I haven't been able to duplictate it.

I can duplicate each line, but not together (in that order). I have to hide
the sheet to get the first line, but activate doesn't work with a hidden
sheet.

Anyone smarter know what's going on?

Thanks,
Jay
 
L

Linq Adams via AccessMonster.com

To my knowledge, Macros are not "recorded by users" in Access as they are in
other Office apps, and the lines you posted

ActiveWindow.Visible = False
ActiveWindow.Activate

don't look at all familiar. This newsgroup is dedicated to MS Access; what
application are you working in? It sounds more like Excel than Access.
 
J

Jay

Whoops. I posted this in the wrong forum. Please ignore, I've reposted it
elsewhere.
 

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

Top