I have this intermittent problem of getting the error message that says "Method 'SaveAs' of object '_Workbook' failed". I'd say at least 80 percent of the time I have no problem. And if there is a problem, I can solve it by deleting the existing file (thus, no overwriting). Sometimes, but not always, I don't even need to delete the existing file. I just re-run the VB script again and it would work. Once when I had the problem, I went to debug and checked every variable in the saveas method and they were fine. What could be causing the problem?
ActiveWorkbook.SaveAs Filename:=destinationPath & (MonthName(Month(voucherDate)) & _
Str(Year(voucherDate))) & "\" & strVoucherName & Format(voucherDate, "dd/mm/yyyy"), _
FileFormat:=xlWorkbookDefault
ActiveWorkbook.SaveAs Filename:=destinationPath & (MonthName(Month(voucherDate)) & _
Str(Year(voucherDate))) & "\" & strVoucherName & Format(voucherDate, "dd/mm/yyyy"), _
FileFormat:=xlWorkbookDefault