I've been calling external code scripts (python in my case), with
but since one of the latest updates to Office 365 this no longer works. cmd window will briefly show up but is killed immediately without the code executing. Running external scripts is definitely a security issue but I was not able to figure out how to bypass security checks and run scripts anyway. Adding documents parent folder to truested locations does not help.
VBA Code:
Private Function runOne(path) As Boolean
Dim wsh As Object
Dim d
Set wsh = VBA.CreateObject("WScript.Shell")
Dim waitOnReturn As Boolean: waitOnReturn = True
Dim windowStyle As Integer: windowStyle = 1
Dim s As String
s = "python " & Chr(34) & path & Chr(34)
d = wsh.Run(s, windowStyle, waitOnReturn)
DoEvents
If d = 0 Then runOne = True
End Function
but since one of the latest updates to Office 365 this no longer works. cmd window will briefly show up but is killed immediately without the code executing. Running external scripts is definitely a security issue but I was not able to figure out how to bypass security checks and run scripts anyway. Adding documents parent folder to truested locations does not help.