I need to do a couple of things that seem to be easy, but I'm having a hard time figuring out how to implement.
I need to create a folder using today's date. That part's fine. Then I need to save a file using text and today's date (also fine).
The part that's got me is that I need to save the new file to the new folder. How can I have the file both save with today's date and save it to the new folder with today's date? (if the file path were constant, I'd be fine to do this, but when part of the path changes according to the date, I don't know how to do this)
This is what I tried, but it's not working. I'm getting the following error: 1004: Application-defined or object-defined error.
Sub filesave() ActiveWorkbook.SaveAs ("S:\HR\TM\" & Format(Now(),"dd.mm.yyyy") & "\SOX recon " & Format(Now(), "dd.mm.yyyy") & ".xlsx") End Sub
This is the code to create the folder (which works perfectly):
Sub FolderCreate() MkDir "S:\HR\TM\" & Format(Now(), "dd.mm.yyyy") End Sub
Please note that the file path/directory has been slightly modified/simplified for security.