title: Refresh Sharepoint-linked Table in Access?
body: <p>I have an access table in 2007 that is linked to a sharepoint list.  When a new record is added to the sharepoint list, the change does not get automatically reflected in the access table.  If you right click on the linked table, there is an option to "refresh list" which does exactly as you would expect.</p>
  
  <p>My question is how to perform this option programatically with powershell or something similar? (.netish)</p>
  
  <p>ADDITION:</p>
  
  <p>I have found that acCmdRefreshSharePointList exists as a way to execute the "refresh list" option.  I am attempting to use it with powershell:</p>
  
  <pre><code>$app = New-Object -ComObject access.application
  $app.OpenCurrentDatabase("C:\foo.accdb")
  
  $acCmd = "acCmdRefreshSharePointList" 
  $app.DoCmd.RunCommand($accCmd)
  </code></pre>
  
  <p>I would hope that that last line would cause the sharepoint-linked table to refresh.  However, I receive the following error:</p>
  
  <blockquote>
    <p>Exception calling "RunCommand" with "1" argument(s): "Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))"
    At line:1 char:22
    + $app.DoCmd.RunCommand &lt;&lt;&lt;&lt; ($acCmd)
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : ComMethodTargetInvocation</p>
  </blockquote>
  
  <p>Can anybody shed light on what I could be doing wrong, or alternative methods of refreshing this list?</p>