|  | end process if application closed |  | |
| | | theintern |  |
| Posted: Fri Aug 29, 2008 11:47 am Post subject: end process if application closed |  |
I have a macro running each time a certain presentation is opened. however, if i close the presentation, and open again, it says it cannot be opened because there is a dialogue box open, i.e. my macro is still running. i can force it to stop by opening the Process tab in the Task Manager, then End Process of POWERPNT.EXT. is there any logic i can put in the macro to end the process if the application is closed?
thanks scott |
| |
| | | Bill Dilworth |  |
| Posted: Fri Aug 29, 2008 1:17 pm Post subject: Re: end process if application closed |  |
Are you using event trapping?
-- Bill Dilworth A proud member of the Microsoft PPT MVP Team Users helping fellow users. LINK -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ vestprog2@ Please read the PowerPoint FAQ pages. yahoo. They answer most of our questions. com LINK .. "theintern" <theintern@discussions.microsoft.com> wrote in message news:1D01076B-D59B-4279-B22F-2C8D1F55809E@microsoft.com...
| Quote: | I have a macro running each time a certain presentation is opened. however, if i close the presentation, and open again, it says it cannot be opened because there is a dialogue box open, i.e. my macro is still running. i can force it to stop by opening the Process tab in the Task Manager, then End Process of POWERPNT.EXT. is there any logic i can put in the macro to end the process if the application is closed?
thanks scott |
|
| |
| | | theintern |  |
| Posted: Fri Aug 29, 2008 1:24 pm Post subject: Re: end process if application closed |  |
| |  | |
To run the macro at the beginning yes, but once the macro is running there is no event trapping. I just have it insert some photos and start the presentation, then wait 5 minutes, delete all photos and close. problem is that i want it to kill the process completely if during those 5 minutes the user closes PP.
"Bill Dilworth" wrote:
| Quote: | Are you using event trapping?
-- Bill Dilworth A proud member of the Microsoft PPT MVP Team Users helping fellow users. LINK -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ vestprog2@ Please read the PowerPoint FAQ pages. yahoo. They answer most of our questions. com LINK .. "theintern" <theintern@discussions.microsoft.com> wrote in message news:1D01076B-D59B-4279-B22F-2C8D1F55809E@microsoft.com... I have a macro running each time a certain presentation is opened. however, if i close the presentation, and open again, it says it cannot be opened because there is a dialogue box open, i.e. my macro is still running. i can force it to stop by opening the Process tab in the Task Manager, then End Process of POWERPNT.EXT. is there any logic i can put in the macro to end the process if the application is closed?
thanks scott
|
|
| |
| | | Steve Rindsberg |  |
| Posted: Fri Aug 29, 2008 5:32 pm Post subject: Re: end process if application closed |  |
| |  | |
In article <D88C40FB-AEB7-4564-9F27-03EC40B45626@microsoft.com>, Theintern wrote:
| Quote: | To run the macro at the beginning yes, but once the macro is running there is no event trapping. I just have it insert some photos and start the presentation, then wait 5 minutes, delete all photos and close. problem is that i want it to kill the process completely if during those 5 minutes the user closes PP.
|
How are you forcing it to wait 5 minutes?
| Quote: | "Bill Dilworth" wrote:
Are you using event trapping?
-- Bill Dilworth A proud member of the Microsoft PPT MVP Team Users helping fellow users. LINK -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ vestprog2@ Please read the PowerPoint FAQ pages. yahoo. They answer most of our questions. com LINK .. "theintern" <theintern@discussions.microsoft.com> wrote in message news:1D01076B-D59B-4279-B22F-2C8D1F55809E@microsoft.com... I have a macro running each time a certain presentation is opened. however, if i close the presentation, and open again, it says it cannot be opened because there is a dialogue box open, i.e. my macro is still running. i can force it to stop by opening the Process tab in the Task Manager, then End Process of POWERPNT.EXT. is there any logic i can put in the macro to end the process if the application is closed?
thanks scott
|
----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: LINK PPTools: LINK ================================================ Live and in personable in the Help Center at PowerPoint Live Sept 21-24, San Diego CA, USA LINK |
| |
| | | theintern |  |
| Posted: Wed Sep 03, 2008 11:05 am Post subject: Re: end process if application closed |  |
| |  | |
Sub Wait2() waitTime2 = 305 start2 = Timer While Timer < start2 + waitTime2 DoEvents Wend End Sub
"Steve Rindsberg" wrote:
| Quote: | In article <D88C40FB-AEB7-4564-9F27-03EC40B45626@microsoft.com>, Theintern wrote: To run the macro at the beginning yes, but once the macro is running there is no event trapping. I just have it insert some photos and start the presentation, then wait 5 minutes, delete all photos and close. problem is that i want it to kill the process completely if during those 5 minutes the user closes PP.
How are you forcing it to wait 5 minutes?
"Bill Dilworth" wrote:
Are you using event trapping?
-- Bill Dilworth A proud member of the Microsoft PPT MVP Team Users helping fellow users. LINK -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ vestprog2@ Please read the PowerPoint FAQ pages. yahoo. They answer most of our questions. com LINK .. "theintern" <theintern@discussions.microsoft.com> wrote in message news:1D01076B-D59B-4279-B22F-2C8D1F55809E@microsoft.com... I have a macro running each time a certain presentation is opened. however, if i close the presentation, and open again, it says it cannot be opened because there is a dialogue box open, i.e. my macro is still running. i can force it to stop by opening the Process tab in the Task Manager, then End Process of POWERPNT.EXT. is there any logic i can put in the macro to end the process if the application is closed?
thanks scott
----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: LINK PPTools: LINK ================================================ Live and in personable in the Help Center at PowerPoint Live Sept 21-24, San Diego CA, USA LINK
|
|
| |
| | | Steve Rindsberg |  |
| Posted: Wed Sep 03, 2008 2:27 pm Post subject: Re: end process if application closed |  |
| |  | |
You might try using the Sleep API instead of a doevents loop:
Put your macro to Sleep LINK
I'm not sure that it'll help, but it's just possible that it might.
W/o seeing the rest of the code, it's hard to say, but it might also help to make the polling interval shorter (much shorter). That is, have it sleep half a second or so, then exit sub instead of continuing to loop if the presentation's gone away.
In article <12CB4CE7-BBF6-4017-A32F-4389F94B236D@microsoft.com>, Theintern wrote:
| Quote: | Sub Wait2() waitTime2 = 305 start2 = Timer While Timer < start2 + waitTime2 DoEvents Wend End Sub
"Steve Rindsberg" wrote:
In article <D88C40FB-AEB7-4564-9F27-03EC40B45626@microsoft.com>, Theintern wrote: To run the macro at the beginning yes, but once the macro is running there is no event trapping. I just have it insert some photos and start the presentation, then wait 5 minutes, delete all photos and close. problem is that i want it to kill the process completely if during those 5 minutes the user closes PP.
How are you forcing it to wait 5 minutes?
"Bill Dilworth" wrote:
Are you using event trapping?
-- Bill Dilworth A proud member of the Microsoft PPT MVP Team Users helping fellow users. LINK -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ vestprog2@ Please read the PowerPoint FAQ pages. yahoo. They answer most of our questions. com LINK .. "theintern" <theintern@discussions.microsoft.com> wrote in message news:1D01076B-D59B-4279-B22F-2C8D1F55809E@microsoft.com... I have a macro running each time a certain presentation is opened. however, if i close the presentation, and open again, it says it cannot be opened because there is a dialogue box open, i.e. my macro is still running. i can force it to stop by opening the Process tab in the Task Manager, then End Process of POWERPNT.EXT. is there any logic i can put in the macro to end the process if the application is closed?
thanks scott
----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: LINK PPTools: LINK ================================================ Live and in personable in the Help Center at PowerPoint Live Sept 21-24, San Diego CA, USA LINK
|
----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: LINK PPTools: LINK ================================================ Live and in personable in the Help Center at PowerPoint Live Sept 21-24, San Diego CA, USA LINK |
| |
|
|