Create folder and then save as before close

Hans10

New Member
Joined
Jul 22, 2015
Messages
8
I want to create at map called a date ex. 02-09-2015
then save the xlsm file and then also save it as a xlsx file.
I want the file name of the xlsx as "Test 02092015 a", where 02092015 i calculated date format(date - 1, "DDMMMYYY")

Sub gem()Dim path As String
FolderName = Format(Date - 2, "DD-MM-YYYY")
path = "C:\Users\olr\Desktop\" & FolderName
If Len(Dir(path, vbDirectory)) = 0 Then
MkDir (path)
End If
ActiveWorkbook.Save
ActiveWorkbook.SaveAs Filename = ("path\" & Test & Format(Date - 2, "DDMMYYYY") a.xlsx), xlWorkbook = 51
ActiveWorkbook.Close
End Sub
 
Per your Reported Post, if you have figured it out, go ahead and post your solution (we do not delete/remove threads once they are solved).
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top