Solved

VB6 Activex exe

Posted on 2004-09-24
4
285 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem to skip loop 6 55
Updates not working for MS Windows 7 12 152
passing parameter in sql procedure 9 56
VB6 - Compare and highlight cell not the same 3 42
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now