save w/o prompted and activate a file

G

Guest

I am using VBA /VB to write some macros in the MS Excel, I would like to ask
some questions :
1. How to save a workheet to a same text file without prompted by replace or
not ?
( ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\lem83mk.MALAYSIA\My Documents\dummy2.txt", _
FileFormat:=xlText, CreateBackup:=False ) . I want the file is saved
automatically when macro is run without promted to be replaced or not.

2. I would like to run a macro that can activate ( double-click ) a batch
file in the directory ( C:\abc.bat ). Can this be done in the VBA macro ?
 
T

Tom Ogilvy

application.DisplayAlerts = False
' code to save file
Application.DisplayAlerts = True

look in vba help at the Shell command.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top