如何通过Application来同时运行两个Sub。

我有一个子如下:

Function SumOf(Byval a As Integer, Byval b As Integer) Call CalHelper.Sum(a,b) Call CalHelper.Sum(a+1,b+1) SumOf = "OK" End Function 

CalHelper模块包含:

 'BEGIN Declare Private mWindowsTimerID As Long Private mApplicationTimerTime As Date Private numberA As Variant Private numberB As String 'END Decalare 'Register `user32` lib's functions BEGIN Public Declare Function SetTimer Lib "user32" ( _ ByVal HWnd As Long, _ ByVal nIDEvent As Long, _ ByVal uElapse As Long, _ ByVal lpTimerFunc As Long _ ) As Long Public Declare Function KillTimer Lib "user32" ( _ ByVal HWnd As Long, _ ByVal nIDEvent As Long _ ) As Long 'Register `user32` lib's functions BEGIN Sub Sum(ByVal a As Integer, ByVal b As Integer) On Error Resume Next mCacheUrl = keyy mCacheValue = valuee On Error GoTo 0 If mWindowsTimerIDCache <> 0 Then KillTimer 0&, mWindowsTimerICache End If mWindowsTimerID = SetTimer(0&, 0&, 1000, AddressOf AfterUDFRoutine1) End Sub Private Sub AfterUDFRoutine1() ' Stop the Windows timer On Error Resume Next KillTimer 0&, mWindowsTimerID On Error GoTo 0 mWindowsTimerID= 0 ' Cancel any previous OnTime timers If mApplicationTimerTimeCache <> 0 Then On Error Resume Next Application.OnTime mApplicationTimerTime, "AfterUDFRoutine2", , False On Error GoTo 0 End If mApplicationTimerTime = Now Application.OnTime mApplicationTimerTime, "AfterUDFRoutine2" End Sub Private Sub AfterUDFRoutine2() ' Do tasks not allowed in a UDF... Application.ScreenUpdating = False Application.Calculation = xlCalculationManual sum =numberA + numberB roww = Sheets(AddSheetCacheHelper.SHEET_CACHE_NAME).Cells(Rows.Count, "A").End(xlUp).Row + 1 Sheet("Result").Cells(roww,1).Value = sum Application.Calculation = xlCalculationAutomatic Application.ScreenUpdating = True End Sub 

我的问题是在SumOf函数中,只有一个调用和运行。 我猜是因为2个调用子是同时发生的,所以mApplicationTimerTime是一样的,而mApplicationTimerTime未知的必须运行什么?

更新 SumOf是我的加载项中的一个function。 这不是一个macros观。