Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problems with taskexists

Status
Not open for further replies.

dbsquared

Programmer
Nov 7, 2002
175
0
0
US
I have code that I have written that loops through great without the taskexists command. Quick background: Code begins to execute then calls a function to open excel I then proceed to loop through again after excel is completed. I used a pause and that worked. When I have the taskexists it doesn't seem to recognize that excel is done all the time. It is very hit and miss which locks up the code and doesn't complete the entire program. I took the pause out because I don't want to have stuff like that hard coded if I can help it.

I have put a pause 1 in it and I have also cleared the variable I use to get the taskid for excel. I am using 95 and 2000 on 2 different machines. I have noticed I have many more issues with 2000 than 95 I have had to hard code some exiting commands because taskexit doesn't work with 2000.

Any help would be appreciated.
Thanks

Dan
 
It looks like from the description that once excel was launched it would go to the next section of code.

I only have one active window and it opens excel and waits for it to complete to go to the next section of code this can loop through more than 70 times depending on the program, I have several programs. On the program that only loops through a few it is fine, the problem occurs on the programs that loop through more than 40 times.
This is an intermittant problem. The code locks up at different times, sometimes the first sometimes the 40th or so, sometimes not at all.
The 95 machine I run the automated script on seems to have the most problem. I haven't run it all the way through on my 2000 machine yet to see if it runs consistantly. To go where no programmer has gone before.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top