Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Macro help .. Overwrite=Yes 1

Status
Not open for further replies.

kristal9

Programmer
Feb 15, 2007
95
US
Hi,

I am trying to edit a recorded macro. Basically the whole thing takes a csv file and fixes it doing a couple of tasks. Finally it needs to save it down and over write a current Excel file...

the code i have for that area is:

Code:
ActiveWorkbook.SaveAs Filename:= _
        "C:\Documents and Settings\kristal9\My Documents\FolderA\myfile.xls" _
        , FileFormat:=xlExcel8, Password:="", WriteResPassword:="", _
        ReadOnlyRecommended:=False, CreateBackup:=False

the macro in all works fine... but when it gets to this point, it still needs to prompt the user to 'click yes' to over write the existing file with todays new book.

is there a way around that? can the script above be altered in a way so that the macro will say okay to over write and there is not need for user input?

just curious.
many thanks!
Kristal
 
For future reference, please post VBa related questions in the VBA forum: Forum707

For this particular issue, use

Application.displayalerts = false

your save code

Application.Displayalerts = true

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Thank you Geoff,

Sorry about getting this in the wrong location. I'll take better care next time.

Kristal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top