I think you are looking for the Shell function: https://msdn.microsoft.com/EN-US/lib.../gg278437.aspx
http://www.taltech.com/support/entry...ation_from_vba
From there, you would need to know the RStudio object model well enough to perform the desired actions.
Bookmarks