我正在尝试在Excel上创建一个运行我创建的R脚本的按钮。这是我尝试过的VBA代码: Sub RunRscript()
Set shell = VBA.CreateObject("WScript.Shell")Dim style As Integer: style = 1Dim path As String
path = "RScript C:\R
VBA代码正在运行,但它没有保存R输出中的文件(Write.CSV文件) runs an external R code through Shell Set shell = VBA.CreateObject("WScript.Shell")
Dim waitTillComplete As Boolean: waitTillCompleteR-3.4.1\bin\
我需要使用WScript.Shell从VBA调用脚本(R)。文件的路径包含空格。此外,还会将一系列参数传递给脚本,其中一些参数还包含空格。Explicit Dim WS_Shell As Object
Set WS_Shell = VBA.CreateObjectR-3.3.2\bin\Rscript.exe"