Solved

VB6 Activex exe

Posted on 2004-09-24
4
288 Views
Last Modified: 2013-12-26
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
0
Comment
Question by:sublimation
  • 2
  • 2
4 Comments
 
LVL 26

Expert Comment

by:EDDYKT
ID: 12144350
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
0
 
LVL 4

Author Comment

by:sublimation
ID: 12144479
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.
0
 
LVL 26

Accepted Solution

by:
EDDYKT earned 500 total points
ID: 12144633
Because you block on the call from excel. If you return your call from exe as soon as possible and do you job from the timer control, then you should be able to click on the cell. You can use call back to return the result back to excel
0
 
LVL 4

Author Comment

by:sublimation
ID: 12144697
Ok, I will try this.  Thanks.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question