Save Error

B

Bruno Coelho

Hi, I have this code in VBA in my template document, but it retrieves to soon
the InputBox (when I open the document) and i want when i close it (like
click in the close button)

Sub AutoNew()

Dim Savepath As String
Dim DocumentName As String
Dim box As String

Savepath = "G:\Administrativos\Credenciais de Deslocação\Dr. Carlos
Pinto\Credenciais Guardadas\"
box = InputBox("Qual o nome que deseja guardar", "Guardar")
DocumentName = box + Format(Now, "YYYY-MM-DD")

ActiveDocument.SaveAs FileName:=Savepath + DocumentName

End Sub

Any sugestion
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top