Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to get the cmd window to close in VBA??

I have written some code to open a program on a PC when a certai
condition exists, this works fine and does the job, however the cm
window is still left open after this operation anyone know how to clos
it in VBA???

Here's the code i use.....

shell("cmd /k C:\notes\notes.exe")

where notes is the program to open.


Simo

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default how to get the cmd window to close in VBA??

On Thu, 17 Jun 2004 03:50:41 -0500, Simon Lloyd
wrote:

I have written some code to open a program on a PC when a certain
condition exists, this works fine and does the job, however the cmd
window is still left open after this operation anyone know how to close
it in VBA???

Here's the code i use.....

shell("cmd /k C:\notes\notes.exe")

where notes is the program to open.


Simon


Remove the "/k" - that specifically tells cmd.exe to run the program you
specify and then remain open. In fact, you should really remove "cmd"
entirely and just do
shell "c:\notes\notes.exe"

--
auric underscore underscore at hotmail dot com
*****
If you only face forward, there is something you will miss seeing.
-- Vash the Stampede (Trigun)
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to get the cmd window to close in VBA??

Auric,

Thanks will try that......this VB/VBA stuff is all very new to me.

Simo

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to get the cmd window to close in VBA??

I tried removing the K/ switch the cmd program launched but did nothin
else....just hung there......is there another solution?

Simo

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default how to get the cmd window to close in VBA??

shell("cmd /C C:\notes\notes.exe")

/C Carries out the command specified by string and then terminates
/K Carries out the command specified by string but remains

--
Regards,
Tom Ogilvy


"Simon Lloyd " wrote in message
...
I tried removing the K/ switch the cmd program launched but did nothing
else....just hung there......is there another solution?

Simon


---
Message posted from http://www.ExcelForum.com/





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default how to get the cmd window to close in VBA??

On Thu, 17 Jun 2004 09:22:31 -0400, Tom Ogilvy wrote:

shell("cmd /C C:\notes\notes.exe")

/C Carries out the command specified by string and then terminates
/K Carries out the command specified by string but remains


....or do as I said: remove "cmd" entirely and just shell straight to
Notes.
--
auric underscore underscore at hotmail dot com
*****
My bleeding eardrums and I take it that was a yes?
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
close find window Gklass Charts and Charting in Excel 1 October 24th 07 10:21 AM
Close Excel mac help window BillyC in Ross Excel Discussion (Misc queries) 0 August 5th 06 07:25 PM
Close Window mark Excel Programming 2 February 20th 04 04:28 PM
close window trapping Yury Lobanov Excel Programming 2 December 23rd 03 05:55 PM
Close Browser window with VBA brianelson Excel Programming 1 July 12th 03 05:35 AM


All times are GMT +1. The time now is 10:39 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"