+ Reply to Thread
Results 1 to 3 of 3

How to count process running time ( process not finished)

  1. #1
    miao jie
    Guest

    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

  2. #2
    gocush
    Guest

    RE: 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


  3. #3
    miao jie
    Guest

    RE: 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??


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1