2

I have a question similar to this one but I'm just using an Excel file, no CSV involved:

Open a .csv file in Excel and have it update whenever .csv file changes

I have an Excel file that I frequently edit in two ways:

  1. manually like most end-users
  2. through an external application (R) that edits some of the content.

I switch back and forth between these two methods.

Is there a way to refresh the contents of the worksheet in Excel after R has edited the contents? I find it annoying to close the workbook and open it again with every edit.

Excel for Mac 2011.

  • 1
    Might try making it a shared workbook, then all you should need to do is make sure both sides are saving after each change. Then all you would need to do is save it to see the changes made by other users, in this case a diff app. – panhandel May 31 '16 at 14:26
1

Not loving this answer as I'm looking for something more internal to Excel, but I can add this AppleScript to the end of my R program and it'll work perfectly.

tell application "Microsoft Excel"
    activate
    open file "Macintosh HD:Users:path:to:file.xlsx"
end tell

This is using R to tell the OS to open Excel via the command line. Therefore, this approach should be tranferable to other programing languages like Python or Java and other operating systems.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.