다음을 통해 공유


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

.BeforeRefresh(Cancel)

A variable that represents a QueryTable object.

Parameters

Name

Required/Optional

Data Type

Description

Cancel

필수

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

참고 항목

개념

QueryTable Object

QueryTable Object Members