Hi Everyone
I hope you can help. I am a bit stuck.
I am using the below code to run a macro to print a selection of data to PDF in a destination folder. At the moment this prompts the user to select which folder/directory to select.
My intention is that I want to set a default folder directory so that on click of the macro the user is forced to save the file in a specific folder, rather than having to browse to it each time.
Please can you assist with what extra line of code is needed to accomplish this and set the default folder for e.g. to: C:\Users\username\Desktop\newfolder?
Many thanks in advance.
I hope you can help. I am a bit stuck.
I am using the below code to run a macro to print a selection of data to PDF in a destination folder. At the moment this prompts the user to select which folder/directory to select.
My intention is that I want to set a default folder directory so that on click of the macro the user is forced to save the file in a specific folder, rather than having to browse to it each time.
Please can you assist with what extra line of code is needed to accomplish this and set the default folder for e.g. to: C:\Users\username\Desktop\newfolder?
Code:
Sub GenerateQuote()
Dim response As VbMsgBoxResult
' GenerateQuote Macro
'
With Worksheets("Dashboard")
If Len(.Range("O19").Value) = 0 Then
response = MsgBox("You have not added any caveats or assumptions!" & Chr(10) & Chr(10) & "Are you sure you want to continue?", 36, "Caveats & Assumptions")
If response = vbNo Then .Activate: .Range("O19").Select: Exit Sub
End If
End With
Worksheets("Quotation").PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
MsgBox "Your quote has been generated!", vbInformation
End Sub
Many thanks in advance.