Sub Test()
Dim d '创建一个变量
'创建Mpp外部对象,将对象实例置变量d中
Set d = CreateObject("Stock.MapValue")
'创建完Map对象后往其内部插入3个数据
call d.SetKey("1",123.5)
call d.SetKey("3","你好")
call d.SetKey("2",1000)
'依次遍历键数据并打印下来
Dim KeyVal
Dim DataVal
For I = 0 to d.Count-1
Result = d.GetAt(i,KeyVal,DataVal)
If result = 1 Then
Application.MsgOut KeyVal&":"&DataVal
End IF
Next
set d = nothing
End Sub直接使用该代码进行测试,执行完毕后,金字塔就异常退出