Save File Name with Date (VBA)

O177812

Board Regular
Joined
Apr 16, 2015
Messages
82
Office Version
  1. 365
  2. 2021
Hi,

I am trying to save my file with the following and recieving an error:

Sheets("BY DC").Select
ChDir "P:\word documents\INW Group\PROCESSED EDI FILES"
ActiveWorkbook.SaveAs Filename:= _
"P:\word documents\INW Group\PROCESSED EDI FILES\Orders created " & Text(TODAY(), "mm-dd-yyyy") & " for ship " & Text(TODAY() + 7, "mm-dd-yyyy") & ".xlsx"
FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False

Can someone please assist?
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
I believe that neither Text nor Today are functions that you can use like that as they are not vba functions. Perhaps you want to use ...Orders created " & Date & ... or if you need a specific date format other than your regional settings, Date will have to be wrapped in the format function. Perhaps like

"P:\word documents\INW Group\PROCESSED EDI FILES\Orders created " & Format(Date, "mm-dd-yyyy") & " for ship " & Format(Date + 7, "mm-dd-yyyy") & ".xlsx"
 
Upvote 0
Solution

Forum statistics

Threads
1,215,239
Messages
6,123,817
Members
449,127
Latest member
Cyko

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