Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB6 Activex exe

Posted on 2004-09-24
4
Medium Priority
?
293 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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 process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

916 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