I would like to creat a excel macro by using vba, which can edit R-scripts.
Let's call this R script starter.R and its working directory is C:/Documents. The Code I want to change is "run=3000". I want to change it to "run=2000".
Firstly I want to open the R-script by using the following code:
Sub ReplaceString()
Dim filename as string
Dim location as String
location="C:\Users\Ken\Documents"
filename="C:\Users\Ken\Documents\start.R"
'Open filename
Then I want to replace the string "run=3000" to "run=2000".
'Replace("run=3000","run=2000")
end sub
Can somebody help me?