I want to be able to schedule a function call passing the workbook reference to the called function.
The closest I have found is the applicaton.ontime option but this will not allow the passing of the workbook reference.
I am calling this from a class addin
There is also the possibility that more than one workbook will be opened at the same time so using the ontime method will cancel one of them out.
Does anyone have any idea how to do this with a workbook reference and with more than one workbook open.
Many thanks in advance.
The closest I have found is the applicaton.ontime option but this will not allow the passing of the workbook reference.
I am calling this from a class addin
Code:
Option Explicit
Private WithEvents XLApp As Application
Private Sub XLApp_NewWorkbook(ByVal wb As Workbook)
XLApp.OnTime Now + TimeSerial(0, 0, 10), "My10secondtest wb"
End Sub
There is also the possibility that more than one workbook will be opened at the same time so using the ontime method will cancel one of them out.
Does anyone have any idea how to do this with a workbook reference and with more than one workbook open.
Many thanks in advance.