Link to home
Start Free TrialLog in
Avatar of sublimation
sublimationFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VB6 Activex exe

Hello, I have an active x exe made in vb6.

which does this:

Sub Test

for i = 1 to 10
   sleep (2000) 'pause for 2 seconds
   msgbox cstr(i)
next i

End Sub


I register this exe and add reference to it in ms excel.

I then reference the object using the CreateObject syntax and run the procedure 'Test'

I thought that being an exe, while this runs in excel, i will be still able to type in the cells (i.e. I thought that being an exe, it would run in its own memory space...)  but i have to wait for the whole procedure from the exe to finish before i can do anything in excel.

How can I have the workbook multitasking, i.e typing in cells while this exe runs the procedure..?

Thanks
Avatar of EDDYKT
EDDYKT
Flag of Canada image

You have to use timecontrol


ie

from your method

timer1.interval = 2000
timer1.enabled = true


In
 Private Sub Timer1_Timer()
static i as integer

i = i + 1
if (i< 10 ) then msgbox cstr(i)


End Sub




etc
Avatar of sublimation

ASKER

Hi,  EDDYKT

I dont understand why i have to use the time control, if the activex was querying a database (so had no need for any timer control) and the query took 1 minute, im still not able to click into the excel cell while this is running.  So it seems to have nothing to do with the timer control.
ASKER CERTIFIED SOLUTION
Avatar of EDDYKT
EDDYKT
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok, I will try this.  Thanks.