fishandtril
New Member
- Joined
- Nov 15, 2022
- Messages
- 15
- Office Version
- 365
- 2021
- Platform
- Windows
Hi
I am trying to automate the SaveAs function to apply the naming based on specific criteria in my worksheet. My code works but I keep getting messages that it needs to be saved in xlsm format which I thought I solved in the code. The code then fails when I select and option on the message. Can anyone help me figure out what I am doing wrong. Thanks
I am trying to automate the SaveAs function to apply the naming based on specific criteria in my worksheet. My code works but I keep getting messages that it needs to be saved in xlsm format which I thought I solved in the code. The code then fails when I select and option on the message. Can anyone help me figure out what I am doing wrong. Thanks
VBA Code:
Sub SaveAsVessel()
Dim path As String
path = "M:\Middle Office\Internal Deal Pricing\Blend Change Shipments\"
Dim fname As String
fname = Range("E5")
With ActiveWorkbook
.SaveAs filename:=path & fname, FileFormat:=51
.Close
End With
End Sub