Sub APPLICATION_VBAStart()
call Application.SetTimer(0,2000) '创建一个0号定时器,间隔时间2秒
End Sub
dim Index '全局变量,记录当前的循环数字
Sub APPLICATION_Timer(ID)
'定时器事件处理
Application.ActivateFrame "Technic" '确保技术分析主框架处于激活状态
Code = Array("CU10","RB10","AL10","AU12")
Market = Array("SQ","SQ","SQ","SQ")
MaxIndex = UBound(Code)
If Index > MaxIndex Then
Index = 0
End if
' 得到框架名称为"Technic",窗格名称为"Main"的窗格对象
Set Grid = Technic.GetGridByName("Main")
'置更换代码数据
call Grid.ChangeStock(Code(Index),Market(Index))
Grid.ReInitDataFormula
Index = Index +1
End Sub
你如果需要切换窗格里的公式,使用Grid.InsertFormula 方法
very good
thanks