Doevents Imported from the msvbvm60 library

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
9,779
Office Version
  1. 2016
Platform
  1. Windows
I am borrowing the rtcDoEvents function from the vba runtime which , in theory, should be exactlly the same as DoEvents because vb/vba inherits from that dll .. however when I test the function like in the following Macro, the keyboard input gets blocked unless you doubleclick the cell to enter edit mode

Code:
Private Declare Function rtcDoEvents Lib "MSVBVM60" () As Long

Sub Macro()
    Do
        rtcDoEvents
    Loop
End Sub

The reason I want to use rtcDoEvents export from the vb runtime istead of just using DoEvents is because I need it in a small program in PowerBasic which doesn't support Doevents or similar functionality

Do you guys experience the same problem with the keyboard input or does this happens just in excel 2007 ?
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Can anybody kindly confirm the keyboard input issue before I take this further ?

Regards.
 
Upvote 0
Ok, problem solved .. I was importing the function from the wrong VB library

here is the code that works the same as DoEvents and without blocking the keyboard input

Code:
Private Declare Function rtcDoEvents Lib "[B]VBE6[/B]" () As Long

Sub Macro()
    Do
        rtcDoEvents
    Loop
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,875
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top