Good morning. I am hoping someone might be able to help me out with this issue. I have been using the code below for a while now and it has performed flawlessly. Now out of the blue, it is not working the same way.
Yes, the code still performs the actions, but it has stopped building the file name based on the specified sheet, cell values. It simply forces me to enter a name for the file it is creating. At face value this is still functioning, however in order to maintain our naming structure, it does not populate the information as intended.
Any thoughts?
Yes, the code still performs the actions, but it has stopped building the file name based on the specified sheet, cell values. It simply forces me to enter a name for the file it is creating. At face value this is still functioning, however in order to maintain our naming structure, it does not populate the information as intended.
Any thoughts?
VBA Code:
Private Sub CommandButton105_Click()
Dim strPath As String
Dim saveAsFilename As Variant
Dim tmpFileName As String
Dim strPathFolder As String
' GENERATE SYSTEM PART NUMBER (Sheet Uses VLOOKUP)
ActiveWorkbook.Unprotect (CAT_PROTECT)
Sheets("System Numbering").Visible = True
Sheets("System Numbering").Select
Sheets("System Numbering").Range("AJ4").Select
Selection.Copy
Sheets("System Numbering").Range("AJ5").Select
ActiveSheet.Paste
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("System Numbering").Visible = False
Sheets("Summary").Select
ActiveWorkbook.Protect (CAT_PROTECT)
UserForm1_LIGHTWELD_COBOT_B.TextBox115.Visible = True
Sheet1.Select
' SAVE QUOTE AS PDF
saveAsFilename = Application.GetSaveAsFilename( _
InitialFileName:=Application.DefaultFilePath & "\" & Sheet1.Range("B5").Value & "-" & Sheet1.Range("C5").Value & "-" & Sheet1.Range("B3").Value & "-FIRM" & "- COBOT-SYSTEM (LightWELD 2000-XR)", _
FileFilter:="PDF File (*.pdf), *.pdf", _
Title:="Save")
If saveAsFilename = False Then Exit Sub
ActiveWorkbook.Unprotect (CAT_PROTECT)
Sheets("COBOT-QUOTE (5)").Visible = True
Sheets("COBOT-QUOTE (5)").ExportAsFixedFormat Type:=xlTypePDF, Filename:=saveAsFilename, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
Sheets("COBOT-QUOTE (5)").Visible = False
ActiveWorkbook.Protect (CAT_PROTECT)
MsgBox "Success - Your completed quote has been save to: " & saveAsFilename & "'.", vbInformation
End Sub