我有一个编辑R脚本的宏。 是R脚本然后应该由下面的VBA被调用:在VBA中运行R脚本错误目录
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:\Program Files\R\R-3.3.2\bin\i386\R.exe" & """ """ & "R RAM Cluster Script.R" & """"
errorCode = shell.Run(path, style, waitTillComplete)
上述代码是从this question。
当我执行宏,但是,r命令行给了我一个错误,指出:
'\\dm\home\myaccount\*Path of my original Excel File*'
"CMD.EXE was started with the above path as the current directory.
UNC Paths are not supported. Defaulting to Windows directory.
Argument 'R RAM Cluster Script.R' Ignored"
脚本存储我的Excel工作簿是在文件夹中
谁能帮助我出去找我的问题?
,如果你尝试运行** [R脚本会发生什么**通过更换用'shell.Run路径,1,TRUE;最后一行?它工作吗? –
不幸的是,不 - 我得到同样的错误。 – reggie86
这个文件存放在哪里R RAM Cluster Script.R? – cyboashu