Jan 23 2022 09:13 PM
Hi all,
i ve got this VBA which save my file using a cell reference as a name, the code seems to work ok, the only issue is, if, and when i decide to re-save excel will ask me if i want to overwrite the existing file. if i answer no the macro will stop and give me a run-time error `1004` can someone please help me to fix it?
thank you in advance
Option Explicit
Sub SvMe()
'Saves filename as value of A1
Dim newFile As String, fName As String
fName = Range("D5").Value
newFile = fName & " "
ChDir _
"C:\Users\Paolo.De Luca\Documents\lETS PLAY WITH MACRO"
ActiveWorkbook.SaveAs Filename:=newFile
End Sub
Jan 23 2022 09:52 PM
SolutionJan 24 2022 01:29 AM
Jan 24 2022 07:22 PM
Jan 24 2022 09:39 PM
Jan 26 2022 02:14 AM
Jan 26 2022 03:07 AM
Jan 26 2022 03:09 AM
Jan 23 2022 09:52 PM
Solution