我正在尝试通过shell命令通过excel vba运行rscript。我在运行时遇到运行时错误70。在Windows 8之前,它工作正常。使用Windows 10我正面临这个问题。这与管理员访问权限有关吗?
VBA代码:
Sub RunRscript()
Dim shell As Object
Set shell = VBA.CreateObject("WScript.Shell")
Dim waitTillComplete As Boolean: waitTillComplete = True
Dim style As Integer: style = 1
Dim errorCode As Integer
Dim path As String
path = """" & "C:\Users\Kreshnaa Raam S B\Documents\R\R-3.5.1\bin\x64\Rscript.exe" & """ """ & Sheet1.Range("C12") & """"
errorCode = shell.Run(path, style, waitTillComplete)
End Sub