title: Suppressing the Data Link Properties dialog box in Excel using VBA
body: <p>While refreshing workbooks with pivots (that are externally linked to another Excel file containing the data) using VBA ( .RefreshAll), a dialog box titled "Data Link Properties" pops up. </p>
  
  <p>I tried to suppress the dialog with DoEvents delays, Application.ScreenUpdating=False, Application.DisplayAlerts=False, OLEDB.BackgroundQuery=False. But nothing seems to be working. </p>
  
  <p>To make matters more confusing, the dialog box doesn't pop up regularly. Sometimes it does, sometimes it doesn't. </p>
  
  <p>My debugging attempts has lead to only one theory: it could be caused by the size of the data file, and thereby the memory Excel is taking up in the RAM. The dialog doesn't seem to pop up when both of these are small. When the file approaches more than 10mb, the dialog becomes more frequent. So I feel it has something to do with memory, even though there's at least 1 GB of available memory. This makes no sense but I've run out of ideas.</p>
  
  <p>Another clue: if I click cancel on the data link properties and click the RefreshAll button on the ribbon: it gives "An unspecified Error" and other errors related to the data file not being found, even though the path is valid, and the file exists.</p>
  
  <p>It will only refresh without any dialogs if I exit the entire Excel Application, reopen and then refresh.</p>
  
  <p>(Closing the Excel Application and re-opening it via a script isn't an option for me, because it will mess up my call stack and end the execution flow.)</p>
  
  <p>I've only found two other links of people discussing this: 
  <a href="http://www.mrexcel.com/forum/excel-questions/492314-suppressing-data-link-properties-dialog.html" rel="nofollow">First has no replies</a> and I can't understand what <a href="http://answers.microsoft.com/en-us/office/forum/office_2010-excel/vba-procedure-to-change-query-table-connection/861c8e4f-3276-416d-a989-5cd624b34486" rel="nofollow">the second one</a> is saying.</p>