I am exploring the possibility of launching a python script via ssh located on a windows server 2016 which shall modify data on a excel xlsx file, bla bla..
I'm able to connect via ssh to the server with public key. I'm able to execute successfully the excel script that make use of xlwings and win32com library when launched within the server in a remote desktop connection. I'm not able to execute the excel script when connected via ssh.
First i've solved a known error linked to the environment by setting the variable: CONDA_DLL_SEARCH_MODIFICATION_ENABLE=1: mkl numpy dll mismatch
Then i had a xlwings access denied via ssh and i've tried without success some combinations from here com access denied I've created the two folders Desktop with full authority for my user. I've followed the following instructions:
- Start, Run, then type mmc comexp.msc.
- Then selected Component Services, Computers, my computer, DCOM Config, Microsoft Excel Application.Right click, select Properties.
- In security i've enabled everything for the user.
Then there are mainly two choices in Identity tabs:
- select "The interactive user".
- select "The launching user" or to provide username and password with "This user".
If I choose the first option, everything works via ssh only if I'm also connected via Remote Desktop connection. If I disconnect from Remote Desktop, via ssh I'm receiving an error of authentication related to the com service in xlwings library. Otherwise if I choose the second option (this user or provide username and password) it doesn't work and moreover office becomes unactivated (if I open it again in the server i have to sign up again for the activation) and opening excel shows also a warning:
cannot use object linking and embedding
If someone has suggestions or explanations they are welcome!