rlv01
Well-known Member
- Joined
- May 16, 2017
- Messages
- 3,112
- Office Version
- 365
- 2010
- Platform
- Windows
Window 10 64bit, ver 1909
Excel / Office 365 MSO v16
This is my first install of 64 bit office and a weird problem has surfaced. Trying to execute a SHELL command causes Excel to freeze. It goes to "not responding" and (must be killed from Task Manager).
Here is simplified test code that produces the freeze for me (except for one scenario described below):
Every existing workbook I've tried with a shell command in the vba code behaves this way. But here's the weird part:
If I create a new workbook, then shift to the VBA editor and paste the above code into the code module, then run it from the debugger - it works fine. But if I SAVE the code, then immediately try to run it from the debugger, it freezes.
I've done some web searching, but can't seem to find anything on point. Any thoughts?
Is anyone else out there who is running 64 bit office under Win 10 experiencing similar issues with the VBA shell command?
Excel / Office 365 MSO v16
This is my first install of 64 bit office and a weird problem has surfaced. Trying to execute a SHELL command causes Excel to freeze. It goes to "not responding" and (must be killed from Task Manager).
Here is simplified test code that produces the freeze for me (except for one scenario described below):
VBA Code:
Sub ShellTest()
Dim ShellStr As String
Dim RetVal
ShellStr = "C:\WINDOWS\NOTEPAD.EXE"
RetVal = Shell(ShellStr, 1) 'freeze occurs when this line is executed
Debug.Print "Function return value: " & RetVal & vbCr
End Sub
Every existing workbook I've tried with a shell command in the vba code behaves this way. But here's the weird part:
If I create a new workbook, then shift to the VBA editor and paste the above code into the code module, then run it from the debugger - it works fine. But if I SAVE the code, then immediately try to run it from the debugger, it freezes.
I've done some web searching, but can't seem to find anything on point. Any thoughts?
Is anyone else out there who is running 64 bit office under Win 10 experiencing similar issues with the VBA shell command?