我使用
订阅路线更改browserHistory.listen(fn)
但我如何取消订阅?
我尝试过分配给listen
null
,但它抱怨自己不是一个功能。
答案 0 :(得分:7)
从Sub Solver_Balances()
'Automated solver to calculate the mass and heat balance
'at each time increment of 1 sec as given by the datalogger
'
Worksheets("Sheet1").Activate
RowCount = 2
Do While Not IsEmpty(Worksheets("Sheet1").Range("H" & RowCount))
SolverReset
SolverOk SetCell:="P" & RowCount, MaxMinVal:=2, ValueOf:=0, _
ByChange:="H" & RowCount, Engine:=1, _
EngineDesc:="GRG Nonlinear"
SolverAdd CellRef:="H" & RowCount, _
Relation:=1, _
FormulaText:="H" & RowCount - 1
SolverAdd CellRef:="L" & RowCount, _
Relation:=3, _
FormulaText:="L" & RowCount - 1
SolverSolve userfinish:=True
SolverFinish keepFinal:=1
RowCount = RowCount + 1
Loop
End Sub
返回的是一个在调用时取消订阅侦听器的函数。所以只需保存以供日后使用:
listen