Have an automated Excel routine I run on a PC, but the one problem I have is
that if Excel is already open I get an error if it tries to open excel
again.
Is there a way to make sure Excel is closed from a Command Prompt in my
Batch File?
Have an automated Excel routine I run on a PC, but the one problem I have is
that if Excel is already open I get an error if it tries to open excel
again.
Is there a way to make sure Excel is closed from a Command Prompt in my
Batch File?
Hi Al,
Al Franz wrote:
> Have an automated Excel routine I run on a PC, but the one problem I
> have is that if Excel is already open I get an error if it tries to
> open excel again.
>
> Is there a way to make sure Excel is closed from a Command Prompt in
> my Batch File?
IMO it would be better to figure out why this is happening instead of
killing Excel. But if you must terminate a process from a batch file,
here's how you could do it:
taskkill /F /IM EXCEL.EXE
Note - this will kill Excel just like it would if you killed it from task
manager, so you'll lose anything you had open and unsaved.
--
Regards,
Jake Marx
MS MVP - Excel
www.longhead.com
[please keep replies in the newsgroup - email address unmonitored]
Is taskkill available in all versions of windows?
(Or better, what version of windows are you running?)
It wasn't found in WinXP Home edition.
Jake Marx wrote:
>
> Hi Al,
>
> Al Franz wrote:
> > Have an automated Excel routine I run on a PC, but the one problem I
> > have is that if Excel is already open I get an error if it tries to
> > open excel again.
> >
> > Is there a way to make sure Excel is closed from a Command Prompt in
> > my Batch File?
>
> IMO it would be better to figure out why this is happening instead of
> killing Excel. But if you must terminate a process from a batch file,
> here's how you could do it:
>
> taskkill /F /IM EXCEL.EXE
>
> Note - this will kill Excel just like it would if you killed it from task
> manager, so you'll lose anything you had open and unsaved.
>
> --
> Regards,
>
> Jake Marx
> MS MVP - Excel
> www.longhead.com
>
> [please keep replies in the newsgroup - email address unmonitored]
--
Dave Peterson
Dave Peterson wrote:
> Is taskkill available in all versions of windows?
>
> (Or better, what version of windows are you running?)
>
> It wasn't found in WinXP Home edition.
Interesting...I don't know. I'm running XP Pro SP2.
--
Regards,
Jake Marx
MS MVP - Excel
www.longhead.com
[please keep replies in the newsgroup - email address unmonitored]
According to ITWorld.com, TaskKill is only included in XP Pro.
--
Scott
"Jake Marx" wrote:
> Dave Peterson wrote:
> > Is taskkill available in all versions of windows?
> >
> > (Or better, what version of windows are you running?)
> >
> > It wasn't found in WinXP Home edition.
>
> Interesting...I don't know. I'm running XP Pro SP2.
>
> --
> Regards,
>
> Jake Marx
> MS MVP - Excel
> www.longhead.com
>
> [please keep replies in the newsgroup - email address unmonitored]
>
>
Thanks to both you and Jake.
Here's a link that describes the parms:
http://www.microsoft.com/resources/d.../taskkill.mspx
(one line in your browser)
And searching the web for alternatives (for WinNT 4.x):
http://www.computing.net/windowsnt/w...rum/22493.html
And a free alternative:
http://www.sysinternals.com/Utilities/PsTools.html
or directly...
http://www.sysinternals.com/Utilities/PsKill.html
Scott wrote:
>
> According to ITWorld.com, TaskKill is only included in XP Pro.
> --
> Scott
>
> "Jake Marx" wrote:
>
> > Dave Peterson wrote:
> > > Is taskkill available in all versions of windows?
> > >
> > > (Or better, what version of windows are you running?)
> > >
> > > It wasn't found in WinXP Home edition.
> >
> > Interesting...I don't know. I'm running XP Pro SP2.
> >
> > --
> > Regards,
> >
> > Jake Marx
> > MS MVP - Excel
> > www.longhead.com
> >
> > [please keep replies in the newsgroup - email address unmonitored]
> >
> >
--
Dave Peterson
Another option to close Excel using WMI
NB: Si,ilar to Jakes in that it terminates as per Taskmanager
Currently, WMI is included when you install;Please Login or Register to view this content.
Microsoft® Windows® 2000,
Windows XP,
Windows Millennium Edition (Me).
For those running Windows 95 OSR 2, Windows 98 or Microsoft® Windows NT® 4.0, a WMI installation package can be downloaded from Microsoft® MSDN® which offers similar functionality as WMI in Windows 2000, Windows XP, and Windows Me.
http://download.microsoft.com/downlo...N-US/wmi9x.exe
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks