bepedicino
Board Regular
- Joined
- Sep 29, 2014
- Messages
- 73
I am using the below VBA within an Excel .xltm file to save the destination file as a .xlsm file. My problem is that when I open the.xltm fie a second time it overrides the .xlsm fle that it saved the first time I opened the .xltm file. Is there something I can do so that the .xlsm does not get overridden?
----------------------------------------------
Sub PrepSpreadsheet()
[code language="vb"]
Sub Autpen()
Const Ffold As String = "\\WS0113\WLDepts$\Administration\Trade Compliance\IT\Integration Point\Daily - Product Classification\" 'change as required
Dim Fname As String
Fname = "Product Classification"
Fname = Fname & " - " & Format(Date, "yyyymmdd") & ".xlsm"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs _
Filename:=Ffold & Application.PathSeparator & Fname, _
FileFormat:=xlOpenXMLWorkbookMacroEnabled
Application.DisplayAlerts = True
End Sub
----------------------------------------------
Sub PrepSpreadsheet()
[code language="vb"]
Sub Autpen()
Const Ffold As String = "\\WS0113\WLDepts$\Administration\Trade Compliance\IT\Integration Point\Daily - Product Classification\" 'change as required
Dim Fname As String
Fname = "Product Classification"
Fname = Fname & " - " & Format(Date, "yyyymmdd") & ".xlsm"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs _
Filename:=Ffold & Application.PathSeparator & Fname, _
FileFormat:=xlOpenXMLWorkbookMacroEnabled
Application.DisplayAlerts = True
End Sub