1

In Excel 2007, when importing data via SQL/ODBC, it displays the message "Getting data" in the top-left cell of the import range. This occurs whether the query is run from the GUI or from VBA.

Can this message be suppressed..??? There seem to be no settings for it, either in the GUI or the VBA object properties of the WorkbookConnection, ODBCConnection, ListObject, or QueryTable.

I would like to create a customized "please wait" message with an animation, but the "Getting Data" message creates a visual conflict.

I tried the following, but it didn't suppress the message:

xl.ScreenUpdating = False
xl.DisplayAlerts = False

ExternalData_1: Getting Data...

enter image description here

braX
  • 11,506
  • 5
  • 20
  • 33
spinjector
  • 3,121
  • 3
  • 26
  • 56

1 Answers1

0

Try disabling BackgroundQuery parameter:

With Selection.QueryTable
   .BackgroundQuery = False
End With
  • Thanks. I think I tried that, but it doesn't fit the situation. The thing is it causes code execution to stop until the query returns, which prevents any do-while loops from being used to monitor the status of the query, and/or offer the user the chance to cancel it if it's taking too long. – spinjector Dec 11 '18 at 13:57