Use sendkeys in save as macro

Closed
smd - Aug 9, 2009 at 08:01 AM
 smd - Aug 10, 2009 at 03:50 AM
Hello,

i've written a macro to copy the "temp" sheet of a workbook to a new workbook and then save tht workbook to an existing file. i get the "do you want to replace existing file" msg box. Using sendkeys i need to over ride the msg box so the user doesnt have to click yes everytime when running the macro.

help is much appreciated.

i also need to schedule a particular workbook and a macro in that book to be run every night at 12.

thanks in advance

1 response

Try this.....

Sub test3()

Application.DisplayAlerts = False
ThisWorkbook.SaveAs Filename:="book2.xls"
ThisWorkbook.Close

End Sub
0
thanks so much guy,

need one more help though. i wrote teh macro to create a temp workbook and save it on a particular folder in the network. i need to open this main workbook automatically at 12midnight every day and run the macro which will generate tht temp workbook.

any help will sure be appreciated
0