Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, everyone
Do VBA support thread method ?? right now I wanna call a time-consuming function to receive data from external system(SAP) call ReceiveData() this function will take some time to get data. sometimes, the external system(SAP) will pop up a message box to tell some warning information. in this case, the function is stop running and waiting user input "enter" key to eliminate that message box to make my VBA program continus running. I don't know how to capture SAP message box in VB, so my purposed solution is count the function running time, if it takes more than 10 minutes(normally less than 10 minutes), I will use VB to simulate "enter" key press with VBA. My question is: how to start a thread to tracking the function running? anybody can help me out, thanks in advance. Public Declare Sub keybd_event Lib _ "user32" (ByVal bVk As Byte, ByVal Scan As Byte, _ ByVal dwFlags As Long, ByVal dwExtraInfo As Long) Sub test() Dim lngStart As Double Dim lngStop As Double Dim lngTime As Double lngStart = Timer ' //// need start a tracking process here ------- help call ReceiveData ' start data receive '//// need check whether the function is running in each of 5 minutes --- help lngStop = Timer ingTime = ingStop - ingStart if ingTime < 10*60 then Call keybd_event(13, 0, 0, 0) ' VB simulate "enter" key press end if End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
tracking time | Excel Discussion (Misc queries) | |||
Time Tracking Help | Excel Discussion (Misc queries) | |||
Tracking Time | Excel Worksheet Functions | |||
Tracking Time | Excel Discussion (Misc queries) | |||
Tracking time | Excel Worksheet Functions |