How to count process running time ( process not finished)
In myproject, need use VBA to call SAP-BW BEX query in a big loop. some
query will potential pop up warning message, in this case, User need manual click "OK" button on pop up warning message to make queries continue running. The problem is, it's very time consuming job so that we usually start it overnight. namely, it's no possible let user stay ahead minitor just do stupid "OK" clicked. I find a way to use VBA to simulate "enter" key press to elimilate warning message. but I don't know how to count process running time which isn't finished (Warning message handing on), any body can help me, thanks in advance. my purposed code as following 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 timeStart as double Dim timeLast as double Dim i as integer for i = 0 to 100 timeStart = Timer ' ******* add time count process, pls help me Call RunSAPBEXQuery(XX,XX,XX) ' if timeLast is large than 5 minites and query is not finished Call keybd_event(13, 0, 0, 0) ' VBA simulate "Enter" key press to elimilate Warning message ' end if Next End Sub |
How to count process running time ( process not finished)
If you just want to avoid the Alert dialog, try
Application.DisplayAlerts=False before starting the the query This will not provide any Time but keeps the code running "miao jie" wrote: In myproject, need use VBA to call SAP-BW BEX query in a big loop. some query will potential pop up warning message, in this case, User need manual click "OK" button on pop up warning message to make queries continue running. The problem is, it's very time consuming job so that we usually start it overnight. namely, it's no possible let user stay ahead minitor just do stupid "OK" clicked. I find a way to use VBA to simulate "enter" key press to elimilate warning message. but I don't know how to count process running time which isn't finished (Warning message handing on), any body can help me, thanks in advance. my purposed code as following 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 timeStart as double Dim timeLast as double Dim i as integer for i = 0 to 100 timeStart = Timer ' ******* add time count process, pls help me Call RunSAPBEXQuery(XX,XX,XX) ' if timeLast is large than 5 minites and query is not finished Call keybd_event(13, 0, 0, 0) ' VBA simulate "Enter" key press to elimilate Warning message ' end if Next End Sub |
How to count process running time ( process not finished)
no, Application.DisplayAlerts=False just forbit Excel pop up Alert dialog.
but unfortunityly, in my case the Alert dislog pop up by SAP Query, not the Excel. how to solve it?? |
All times are GMT +1. The time now is 12:27 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com