Macro doesn't execute fully using shortcut

P

Poody

I'm baffeled - I have a macro that was written to open 4 text files as fixed
width files and place them in the same workbook on different worksheets. The
macro runs fine, but only if I launch it from the VBA Editor, or from the
Tools -> Macros window and select the macro and click run. I have assigned a
shortcut key combination (CTRL+SHIFT+Q). If open Excel and use that
shortcut, the macro launches, but stops immediately after opening the first
file. No error messages or anything like that.

How do I correct this problem?

I'm running Excel 2003
The macro is in my Personal.xls, and that file is hidden

Thanks for any help,

Rich
 
D

Dave Unger

Hi Dave

Remove the shift key from your short cut key combination.

I just ran into a similar situation, and discovered that removing the
shift key fixed the problem. But I was unable to come up with a
"why". Then I came across your reply, and I'm hoping you could
explain the "why" to your solution. Thanks,

Regards

Dave U.
 
D

Dave Peterson

Holding the shift key down when you open a workbook disables the auto run macros
(workbook_open and auto_open).

If it's in the shortcut, it confuses excel so that it thinks it shouldn't be
running macros. So your "real" macro stops.
 
D

Dave Unger

Hi Dave,

Oh, yes !! I'm ashamed to admit how much time I wasted over this,
troubleshooting some fairly complex code before stumbling on to the
cause. Oh well, live & learn!

Thanks for this, Dave.

Regards,

Dave U
 
D

Dave Peterson

Dave's have to stick together <vbg>.

Dave said:
Hi Dave,

Oh, yes !! I'm ashamed to admit how much time I wasted over this,
troubleshooting some fairly complex code before stumbling on to the
cause. Oh well, live & learn!

Thanks for this, Dave.

Regards,

Dave U
 

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