Yes, that appears to have been the problem. The code is working now and generating a pdf with the dynamic name as intended. I've added the following code to all userform controls related to generating the pdfName string to prevent users from entering special characters into those fields:
Private Sub controlname_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Select Case KeyAscii
Case Asc("0") To Asc("9")
Case Asc("A") To Asc("Z")
Case Asc("a") To Asc("z")Case Asc(" ") To Acs(" ")
Case Else
KeyAscii = 0
End Select
End Sub
I will mark this as solved.
Bookmarks