Help with arguments for Excel.Workbook.SaveAs function
Posted on 2006-06-30
I am trying to add a line to a VB function in Access. The function actually builds an excel spreadsheet. I want to overwrite an existing excel file with the newly built one everytime the script is run. I just can't get excel to stop prompting me about overwriting an exsiting file. Is there an argument to the SaveAs method that can turn off prompting?
My current code is:
directory = "H:\Daily Numbers\" & Year(Now()) & "\" & MonthName(Month(Now())) & " " & Year(Now())
ActiveWorkbook.SaveAs FileName:= _
directory & "\Monthly Reporting " & MonthName(Month(Now())) & " " & Year(Now()) & "_DB.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
Thanks in advance.