Using WinWrap, trying to open Notepad and paste the Clipboard text inside. I mean, it works on Windows 10 but on Windows 11 it seems like the TaskID returned from Shell command is wrong, so the AppActivate(TaskID) fails.
Notepad opens and I can see the text pasted, but I'm inside an "On Error" statement, so an error message appears to the user. The error description is "Impossible to find the window".
This is the part of the code:
Clipboard Msg & vbCrLf
TaskID = Shell("Notepad",vbNormalFocus )
Debug.Print(TaskID)
AppActivate(TaskID)
SendKeys("^V"),1 'Control-V
If I take a look to the debug, I can see that the TaskID is different from the notepad PID on the task manager.
Any suggestion?