You can use the actxserver
function in MATLAB to open an Excel file and then use the invoke
function to interact with it. Here is an example code that opens an Excel file and keeps it open until you close it manually:
main.m431 chars21 lines
This code will open the example.xlsx
file and keep it open until you close it manually. The saved
property of the workbook object is set to 0 until you save and close the file, so we can use a while loop and pause
function to continually check if the file is closed yet. Once it is closed, the loop will exit and the Excel application will be closed.
gistlibby LogSnag