Quote:
|
Originally Posted by Alexxx12
hi,
I am saving the same workbook mulitple times during the week through code in a macro. Right now it prompts me to the existence of the same workbook and if i want to replace it.
ActiveWorkbook.SaveAs FileName:="\\USERSTATS\" & Range("C1").Value & ".xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
|
Delete the file before saving a copy to the same location.
strFPath = "testPath"
If Dir(strFPath) Then Kill strFPath
---------------
Kill Statement Example
This example uses the Kill statement to delete a file from a disk.
' Assume TESTFILE is a file containing some data.
Kill "TestFile" ' Delete file.
' Delete all *.TXT files in current directory.
Kill "*.TXT"
----------------
Found in Excel VB Help, just type Alt+HH, can also place cursor on a word in the editor and hit the F1 Key.