If you are connected via SSH then that is a separate session independent of the main (Desktop) session. So desktop is not running in your SSH session and you won't be able to run any GUI programs.
You will need to connect to the RPi with RDP or VNC to get a remote GUI session.