I ran into a strange problem, I decided to assign a keyboard shortcut Ctrl + Shift + P
on one of my routine in VBA. This routine is suppose to open an existing
Apparently, after multiples google search about that particular problems, it seems that
Application.Workbooks.Open(yourPath)
mixed with the Shift keyboard key in your shortcut is the problem. More precisely from this guy if you look at the last answer:
The shift key makes a vb script stop at any Open statement.
So you have two solutions
Remove the Shift key from your shortcut and choose another one
Instead of using .Open
, you could use .Add
which will do the same job, but the code won't hang. So if you do Application.Workbooks.Add(yourPath)
it should behave properly.
It is funny though, that both Open
and Add
have the exact same behavior when you look at the screen while running the Macro.
Edit: I couldn't find any official link referring to that bug.