Skip to content

Latest commit

 

History

History
52 lines (32 loc) · 1.25 KB

Excel.QueryTable.BeforeRefresh.md

File metadata and controls

52 lines (32 loc) · 1.25 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
QueryTable.BeforeRefresh event (Excel)
vbaxl10.chm519073
vbaxl10.chm519073
Excel.QueryTable.BeforeRefresh
763cfe16-d48c-07f2-73e1-5c59021b4e58
05/03/2019
medium

QueryTable.BeforeRefresh event (Excel)

Occurs before any refreshes of the query table. This includes refreshes resulting from calling the Refresh method, from the user's actions in the product, and from opening the workbook containing the query table.

Syntax

expression.BeforeRefresh (Cancel)

expression A variable that represents a QueryTable object.

Parameters

Name Required/Optional Data type Description
Cancel Required Boolean False when the event occurs. If the event procedure sets this argument to True, the refresh doesn't occur when the procedure is finished.

Return value

Nothing

Example

This example runs before the query table is refreshed.

Private Sub QueryTable_BeforeRefresh(Cancel As Boolean) 
 a = MsgBox("Refresh Now?", vbYesNoCancel) 
 If a = vbNo Then Cancel = True 
 MsgBox Cancel 
End Sub

[!includeSupport and feedback]