This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Refresh/update screen while Macro is running

Hello from France, 

At work, we are using an old version of 'Reflection for Unix and digital'. 

To simply my job, I'm trying to write a vba macro to get text (numbers) from the screen. As the numbers change regularly, I would like to get the values from the screen every 30 seconds until a certain condition happens. 

The problem is that when the macro is running, the screen doesn't update/refresh. I tried several things like 'doevents' with no success. 

Is there a way I can run a macro with 'loop until' and let the screen update at the same time. I need to run the macro without blocking the screen.

Any help would be much appreciated. 

Best regards, 

James 

Tags:

Labels:

Reflection
  • 0  

    With Reflection for Digital Graphics, you are talking about 17 year or older software.  So you should consider updating that software.  The best place to start is the documentation:

    Visual Basic User Guide

    Generally speaking, if you have code at this point that collects the numbers that you are expecting then I would think you would just need to create a while loop that states while this condition is not met do the code that you have working now.  If the application requires keyboard interaction to get the next number to show up, then you would need to incorporate send keys to get to the next screen inside the while loop.

    From within the VBA editor use help to get the correct syntax for the 'while' and 'sendkeys' commands.

    Regards,

    Jeff

  • 0 in reply to   

    Good Morning,

    Many thanks for your reply. I am using 'Reflection for Unix and Digital' version 8.00.076. It is old !

    I'm just an end user so I can't upgrade the software. I'm trying to do something like this example

    Sub test()
    Dim a, tmp
    With Session

    tmp= Timer
    Do While Timer < tmp + 30
    DoEvents

    ' THE SCREEN DOESN'T REFRESH/UPDATE
    Loop
    a = .GetText(4, 58, 4, 60)
    a = CInt(a)
    Loop Until a < 10
    ' Do things

    End With
    End Sub

    The problem is that the screen doesen't refresh in the DO... LOOP

    Regards,

    James