我試過Set D = CreateObject("SCRIPTING.DICTIONARY")
然後a=D 結果失敗
也試過Set a =D
結果a就真的等於D,D也被remove掉了
不懂你的說法,可po程式碼 看看
Option Explicit
Sub EX()
Dim D As Object, i As Integer, a
Set D = CreateObject("SCRIPTING.DICTIONARY")
For i = 1 To 50
D(i) = i * 2
Next
Stop
MsgBox D.Count
a = D(5)
MsgBox a
Stop
MsgBox D.Count '沒被Remove掉
End Sub
複製代碼
作者: Kubi 時間: 2016-8-10 10:14
回復 5#GBKEE
版大的狀況可能如下:
Sub test()
Dim D As Object, COPYD As Object, i As Integer
Set D = CreateObject("SCRIPTING.DICTIONARY")
Set COPYD = CreateObject("SCRIPTING.DICTIONARY")
For i = 1 To 50
D(i) = i * 2
Next
MsgBox "D原始數量:" & D.Count