Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2
Default Excel to Run a Batch File?!?

Hi

I am running Office 2003. I have designed an excel spreadsheet using
various macros. I now need a macro designed that can run a batch file.
Is this possible?

Hope you guys can help!

Thanks Alot

Carla

  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 22,906
Default Excel to Run a Batch File?!?

Carla

Sub Run_Batch()
Dim taskID As Variant
On Error Resume Next
Shell ("C:\yourbatch.bat"), vbNormalFocus
If Err < 0 Then _
MsgBox "yourbatch.bat is Missing"
End Sub


Gord Dibben MS Excel MVP

On 19 Jan 2007 00:54:17 -0800, "carla" wrote:

Hi

I am running Office 2003. I have designed an excel spreadsheet using
various macros. I now need a macro designed that can run a batch file.
Is this possible?

Hope you guys can help!

Thanks Alot

Carla


  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3,101
Default Excel to Run a Batch File?!?

Carla,

Check out the Shell command in VB help.
and use a command along the lines of:-

returnedvalue=Shell("C:\yourpath\yourfile.bat", 1)

Mike

"carla" wrote:

Hi

I am running Office 2003. I have designed an excel spreadsheet using
various macros. I now need a macro designed that can run a batch file.
Is this possible?

Hope you guys can help!

Thanks Alot

Carla


  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 7,247
Default Excel to Run a Batch File?!?

See the Shell function. If you need to wait for the Shell'd process to end
before continuing your code execution, see
http://www.cpearson.com/excel/shellandwait.htm.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"carla" wrote in message
oups.com...
Hi

I am running Office 2003. I have designed an excel spreadsheet using
various macros. I now need a macro designed that can run a batch file.
Is this possible?

Hope you guys can help!

Thanks Alot

Carla



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
Stop excel from dropping the 0 in the beginning of a number? Rosewood Setting up and Configuration of Excel 12 April 4th 23 02:12 PM
Need to Query Excel File Opened by Another User Paul Excel Discussion (Misc queries) 0 December 13th 06 05:57 PM
Retaining formats grok Excel Discussion (Misc queries) 11 October 31st 06 07:29 PM
importing a particular excel worksheet into another excel file dinouk Excel Worksheet Functions 0 August 10th 06 02:03 PM
How do I unlock FILE access? rcmodelr Excel Discussion (Misc queries) 7 November 12th 05 09:55 PM


All times are GMT +1. The time now is 08:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"