Home > database >  VBA Shell no longer working in Windows 11
VBA Shell no longer working in Windows 11

Time:03-04

I recently updated to Windows 11 and I notice that the Shell call does not longer open the Notepad.

It seems that Windows 11 now has notepad in the "C:\Windows" directory as well as the "C:\Windows\System32" directory but when I run this command using either, it no longer opens the notepad, it just runs and nothing happens

Dim x As Variant
x = Shell("C:\Windows\system32\notepad.exe ""C:\test.txt""")

Is anyone else experiencing this behavior or found a way around it?

CodePudding user response:

Adding vbNormalFocus did the trick. Thank you David

  • Related