I am trying to write a macro that will save the same document 31 times, renaming it each time to match each day of the month. The prompts for the macro work, and I can see the notice in the lower right hand corner of the excel window stating that iterative copies of the document are being saved, but the folder remains empty after the process is complete. I am executing the macro inside the folder that I want the copies to be saved to, so I have not specified a file path in the macro. If I execute the code a second time, I get a prompt asking me if I would like to overwrite the previous copy of the document (even though none exists in the active folder). Can anyone tell me what is wrong with my code?
Sub transmittals()
myMonth = Application.InputBox(Prompt:="Input month as a number", Type:=1)
myYear = Application.InputBox(Prompt:="Input year as a two-digit number", Type:=1)
For i = 1 To 31
ActiveWorkbook.SaveAs (myMonth & "." & i & "." & myYear & ".xlsm")
'Alternatively I have also tried the line of code below:
'ActiveWorkbook.SaveAs Filename:=myMonth & "." i & "." & myYear, FileFormat:= 53
Next
End Sub
Bookmarks