Forum

Save Copy of file L...
 
Notifications
Clear all

Save Copy of file Leave Blank Template Open

3 Posts
2 Users
0 Reactions
91 Views
(@webbers)
Posts: 147
Estimable Member
Topic starter
 

Macro needs some help.  This macro works, but I want it to do one more thing.  I have a button for it on my ribbon, as I use it often.  I have a hard coded path for this macro, and the filename is in cell B28 of the file.  What I want to accomplish is to save a COPY of the file with the file name in cell B28, and leave my template open, with no cells entered.  I have done this before, but I cannot find the code.  Can anyone help?  Thanks in advance.

 

Sub SaveAppSubmit()

Dim SaveName As String
SaveName = ActiveSheet.Range("B28").Text
ActiveWorkbook.SaveAs filename:="D:DocumentsNew" & _
SaveName & ".xlsx"

End Sub

 
Posted : 23/04/2022 2:36 pm
(@catalinb)
Posts: 1937
Member Admin
 

Hi Sherry,

Instead of SaveAs, use SaveCopyAs, will leave the current workbook intact.

 
Posted : 25/04/2022 11:46 pm
(@webbers)
Posts: 147
Estimable Member
Topic starter
 

@Catalin Bombea,

Such a simple subtle difference is the answer.  Thanks so much.  I was so close, but just could not see it!  Thanks again for your assistance!

 
Posted : 26/04/2022 12:50 pm
Share: