Excel macro stalls when executing from keyboard

medic5678

Board Regular
Joined
Nov 13, 2018
Messages
60
Hi everyone! I have written a macro which works perfectly except it hangs when I execute it from the keyboard. In this macro, I open an excel file and update it, then save it and close it. When I start it from the keyboard, it opens the file to update, then simply quits. The active window and worksheet is the file I opened. Any idea why it should behave differently based on how you start it? I have just changed the hotkey combination from ctrl +shift + W to ctrl + g. Works fine from the keyboard now. Anyone know what's going on with this? Thanks!
 

Some videos you may like

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Anthony47

Well-known Member
Joined
Mar 29, 2006
Messages
1,992
If you open a file while keeping the Shift key pressed (as to obtain W) then the new file opens but is macro are disabled. This explain why using "g" (low case) works

Bye
 

medic5678

Board Regular
Joined
Nov 13, 2018
Messages
60
I never though about the shift key interacting with the letter you are pressing. Funny that excel would steer you that way when assigning hotkeys to macros.
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
36,150
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
It's a bug, really, and only occurs if your macro is opening other workbooks. See Jan Karel's article here: Excel: Workbook Open Bug
 

Watch MrExcel Video

Forum statistics

Threads
1,123,206
Messages
5,600,317
Members
414,376
Latest member
NickYOW

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top