1. Creation of batch file

  Sub Create_bat()
    open "c:\path\to\file.bat" for output as #1 ' open the batch file
    ' Add print codes as required (to be printed to the batch file) e.g,
    Print #1, "copy " & cells(1,1) & " abc.txt"
    close #1 ' close the file
  end sub

2. running the batch file from macro

   Sub runBat()
      dim RetVal
      RetVal = Shell("c:\path\to\file.bat",vbNormalFocus)
   End Sub

Hope it helps.
Akhilesh Kumar Karna


On Mon, Jun 15, 2009 at 8:11 PM, bharghav r <bhargha...@gmail.com> wrote:

>
>  Hi ,
>
> Need help in creating n exceuting  batch files using excel macro.
>
> Requirement:
>
> 1.Batch file should be generated and exceuted on the click of a active x
> button.
> 2.Batch file contents  has to take inputs from the same excel file like
> application name and database name.
>
>
> --
> Thanks and Regards
>
> Bharghav R
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
-------------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com
-------------------------------------------------------------------------------------
-~----------~----~----~----~------~----~------~--~---

Reply via email to