Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Two Question

Hi,
I have this shell command in VBA
x = Shell("cmd.exe /c dir /Tw/S " & sPath & "*." & LCase(sFileExtension) &
" " & _
ThisWorkbook.Path & "\Directory.txt", 1)
which works fine, but i need to wait until it has finished running before
going to the next command

I use Sheets("Directory").Delete to delete this sheet but it asks if I
want to delete this sheets, how do I get rid of the message.

Thanks MarkS
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Two Question

#1.

If you're lucky and you know that your .cmd file always takes less than x
seconds, you could add application.wait (x + 30% seconds)
(or whatever you feel comfortable with.)

But there are other ways.

http://support.microsoft.com/?kbid=214248
XL2000: How to Force Macro Code to Wait for Outside Procedure
or

Here's a link to a nice ShellAndWait function that does that.
http://groups.google.com/groups?thre...%40tkmsftngp03

#2.

application.displayalerts = false
'delete the sheet
application.displayalerts = true


MarkS wrote:

Hi,
I have this shell command in VBA
x = Shell("cmd.exe /c dir /Tw/S " & sPath & "*." & LCase(sFileExtension) &
" " & _
ThisWorkbook.Path & "\Directory.txt", 1)
which works fine, but i need to wait until it has finished running before
going to the next command

I use Sheets("Directory").Delete to delete this sheet but it asks if I
want to delete this sheets, how do I get rid of the message.

Thanks MarkS


--

Dave Peterson
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
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good davegb Excel Programming 1 May 6th 05 06:35 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 27th 05 07:46 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 23 April 23rd 05 09:26 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 22nd 05 03:30 PM


All times are GMT +1. The time now is 06:03 PM.

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"