範例一Dim INP As String
INP = ActiveSheet.Name
With Worksheets(INP)
For Each qyt In .QueryTables
qyt.Delete
Next
End With
範例二Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim qyt As QueryTable
For Each qyt In Worksheets("xxx").QueryTables
qyt.Delete
Next
Set qyt = Nothing
End Sub
問題1. 請問上面兩段是為了清除連線嗎?
問題2. 第二段有加 Set qyt = Nothing, 用意為何? 又代表什麼?
問題3. 常聽友人說迴圈抓網頁資料會越變變慢?為何?