Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default vba to loop until process finished

Hi,

I'm not so hot on DOS commands so thought I'd better consult!


I'm launching an application from vba then instructing it to run it's
own script as follows:


***


Set oSplus = CreateObject("S-PLUS.Application")
oSplus.executestring ("source(""c:\\" & scriptToRun & """,
echo=T)")


***


The script that the application ( splus) runs takes a looong time at
the end of which S plus closes. I want the launching vba to wait
until
excel closes (i.e, sit in a loop for a while) before continuing in
its own execution.


Not sure how to do this - any pointers would be greatfully
recieved...


Many thanks


Chris

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default vba to loop until process finished

Depends on what this S-Plus exposes.
Does it have a asynchronous/background property that you can set to false ?
Or does it raise any events like ScriptComplete that you can react to ?

NickHK

wrote in message
oups.com...
Hi,

I'm not so hot on DOS commands so thought I'd better consult!


I'm launching an application from vba then instructing it to run it's
own script as follows:


***


Set oSplus = CreateObject("S-PLUS.Application")
oSplus.executestring ("source(""c:\\" & scriptToRun & """,
echo=T)")


***


The script that the application ( splus) runs takes a looong time at
the end of which S plus closes. I want the launching vba to wait
until
excel closes (i.e, sit in a loop for a while) before continuing in
its own execution.


Not sure how to do this - any pointers would be greatfully
recieved...


Many thanks


Chris



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default vba to loop until process finished

Thanks for replying Nick,

Not entirely sure to be honest... I was hoping there would be a way to
get it's dos handle and poll until that disapeared? I think I can do
this if I Shell() the S plus to start it, but don't really want to do
that.

The quick hack is to add to the S plus script to create a file once
its finished then poll on the existance of that file - but that seems
inelegant.

Chris


On Jun 15, 4:25 am, "NickHK" wrote:
Depends on what this S-Plus exposes.
Does it have a asynchronous/background property that you can set to false ?
Or does it raise any events like ScriptComplete that you can react to ?

NickHK

wrote in message

oups.com...



Hi,


I'm not so hot on DOS commands so thought I'd better consult!


I'm launching an application from vba then instructing it to run it's
own script as follows:


***


Set oSplus = CreateObject("S-PLUS.Application")
oSplus.executestring ("source(""c:\\" & scriptToRun & """,
echo=T)")


***


The script that the application ( splus) runs takes a looong time at
the end of which S plus closes. I want the launching vba to wait
until
excel closes (i.e, sit in a loop for a while) before continuing in
its own execution.


Not sure how to do this - any pointers would be greatfully
recieved...


Many thanks


Chris- Hide quoted text -


- Show quoted text -



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default vba to loop until process finished

But as this is an Active component, which you are using COM with, you may as
well check out it available properties.
Use the Object Browser in VBA.

Otherwise, maybe one of the examples of ShellAndWait on the web will do.

NickHK

wrote in message
ps.com...
Thanks for replying Nick,

Not entirely sure to be honest... I was hoping there would be a way to
get it's dos handle and poll until that disapeared? I think I can do
this if I Shell() the S plus to start it, but don't really want to do
that.

The quick hack is to add to the S plus script to create a file once
its finished then poll on the existance of that file - but that seems
inelegant.

Chris


On Jun 15, 4:25 am, "NickHK" wrote:
Depends on what this S-Plus exposes.
Does it have a asynchronous/background property that you can set to

false ?
Or does it raise any events like ScriptComplete that you can react to ?

NickHK

wrote in message

oups.com...



Hi,


I'm not so hot on DOS commands so thought I'd better consult!


I'm launching an application from vba then instructing it to run it's
own script as follows:


***


Set oSplus = CreateObject("S-PLUS.Application")
oSplus.executestring ("source(""c:\\" & scriptToRun & """,
echo=T)")


***


The script that the application ( splus) runs takes a looong time at
the end of which S plus closes. I want the launching vba to wait
until
excel closes (i.e, sit in a loop for a while) before continuing in
its own execution.


Not sure how to do this - any pointers would be greatfully
recieved...


Many thanks


Chris- Hide quoted text -


- Show quoted text -





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop until finished David A. Excel Discussion (Misc queries) 0 September 17th 07 08:00 PM
Loop until finished. David A. Excel Discussion (Misc queries) 0 September 17th 07 08:00 PM
How to count process running time ( process not finished) miao jie Excel Programming 0 January 13th 05 09:23 AM
How to count process running time ( process not finished) miao jie Excel Programming 2 January 12th 05 06:01 AM
Do Loop doesn't process kls[_2_] Excel Programming 0 September 20th 04 05:48 PM


All times are GMT +1. The time now is 11:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"