我有一個編輯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