Rスクリプトを編集するマクロがあります。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スクリプトは、次のVBAによって呼び出されると想定されていることを 。私はマクロを実行すると
、ただし、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ワークブックが入っているフォルダに格納され
誰でも助けることができます私の問題を見つけることと私は?
最後の行を 'shell.Run path、1、True'に置き換えて** Rスクリプト**を実行しようとするとどうなりますか?それは動作しますか? –
残念ながら、いいえ、同じエラーが発生します。 – reggie86
このファイルはどこに保存されていますか?R RAM Cluster Script.R? – cyboashu