title: actxserver communication between Matlab and Excel
body: <p>I have an existing (opened and empty) file "D:\api.xlsx" and need to communicate with it from Matlab.
  First, I try to read values from A1:B2, and insert new values:</p>
  
  <pre><code>excelapp = actxserver('Excel.Application');
  wkbk = excelapp.Workbooks;
  wdata = wkbk.Open('D:\api.xlsx');
  sheet = wdata.ActiveSheet;
  range = sheet.get('Range', 'A1:B2');
  range.Value
  ans = 
  
      [NaN]    [NaN]
      [NaN]    [NaN]
  
  range.Value = magic(2);
  &gt;&gt; range.Value
  
  ans = 
  
      [1]    [3]
      [4]    [2]
  </code></pre>
  
  <p>But I don't see the changes in the excel. The range A1:B2 remains empty.
  Similarly, when I manually insert new values into excel, the <code>range.Value</code> returns the old values.</p>
  
  <p>So, there are two questions:</p>
  
  <ol>
  <li><p>How to insert values into an opened excel file from Matlab, so the new values become immediately visible?</p></li>
  <li><p>How to get into Matlab the updated (from Excel) values?</p></li>
  </ol>