![]() |
Task Manager (shut down a task if active)
Is there a way to close an application called "PDFCreator" if it happens to
be still active? The problem that I have in running PDFCreator is that it doesn't always shut down before the next instance of running, and won't create the PDF. I'm using code from Ken Puls website, and have coded in both of his suggestions to shut it down and waittime, but it still creates problems. I have to open the task manager and close PDFCreator manually, which is a pain in the neck in automated code. What I'd like to do is get VB to see if PDFCreator is running, and if it is then shut it down, before running it again. Can VB access the task manager? Is there anything that could be done with the following code (from VB help)? Regards, Brett. Application.Interactive = False Application.DisplayAlerts = False channelNumber = Application.DDEInitiate( _ app:="WinWord", _ topic:="C:\WINWORD\FORMLETR.DOC") Application.DDEExecute channelNumber, "[FILEPRINT]" Application.DDETerminate channelNumber Application.DisplayAlerts = True Application.Interactive = True |
Task Manager (shut down a task if active)
See:
http://groups.google.com/group/micro...9fa19fc80add26 -- Gary''s Student - gsnu200835 "Brettjg" wrote: Is there a way to close an application called "PDFCreator" if it happens to be still active? The problem that I have in running PDFCreator is that it doesn't always shut down before the next instance of running, and won't create the PDF. I'm using code from Ken Puls website, and have coded in both of his suggestions to shut it down and waittime, but it still creates problems. I have to open the task manager and close PDFCreator manually, which is a pain in the neck in automated code. What I'd like to do is get VB to see if PDFCreator is running, and if it is then shut it down, before running it again. Can VB access the task manager? Is there anything that could be done with the following code (from VB help)? Regards, Brett. Application.Interactive = False Application.DisplayAlerts = False channelNumber = Application.DDEInitiate( _ app:="WinWord", _ topic:="C:\WINWORD\FORMLETR.DOC") Application.DDEExecute channelNumber, "[FILEPRINT]" Application.DDETerminate channelNumber Application.DisplayAlerts = True Application.Interactive = True |
Task Manager (shut down a task if active)
Hi there GS, you've been giving me quite a few tips lately eh?. Thanks for
all of that. Now then, that page has a hell of lot of code in there, but when I clicked on the link it went straight to for /f "tokens=1" %%a in ('tlist ^| findstr /i %1') do echo kill %%a /f for which I would subtitute for /f "tokens=1" %%a in ('tlist ^| findstr /i PDFCreator') do echo kill %%a /f but surely that is not all I need to code? It's a task that I want to kill (maybe a process, but right now I don't know the process name) Regards, Brett "Gary''s Student" wrote: See: http://groups.google.com/group/micro...9fa19fc80add26 -- Gary''s Student - gsnu200835 "Brettjg" wrote: Is there a way to close an application called "PDFCreator" if it happens to be still active? The problem that I have in running PDFCreator is that it doesn't always shut down before the next instance of running, and won't create the PDF. I'm using code from Ken Puls website, and have coded in both of his suggestions to shut it down and waittime, but it still creates problems. I have to open the task manager and close PDFCreator manually, which is a pain in the neck in automated code. What I'd like to do is get VB to see if PDFCreator is running, and if it is then shut it down, before running it again. Can VB access the task manager? Is there anything that could be done with the following code (from VB help)? Regards, Brett. Application.Interactive = False Application.DisplayAlerts = False channelNumber = Application.DDEInitiate( _ app:="WinWord", _ topic:="C:\WINWORD\FORMLETR.DOC") Application.DDEExecute channelNumber, "[FILEPRINT]" Application.DDETerminate channelNumber Application.DisplayAlerts = True Application.Interactive = True |
All times are GMT +1. The time now is 04:50 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com