I have several macros to print certain sheets to PDF in my spreadsheet. The work in my uncompiled spreadsheet.
After compiling to exe they no longer work. I do have the option to export to PDF selected.
Any help is appreciated. I am using version 2020.1 of XLS Padlock.
Edited to add: It turns out that it does create the document, but it does not open it like it does before compiling. It leaves a blank screen up that you have to close and then go looking for the document.
Is there a way to make it show the PDF after it is created, like it does before compiling?
Sub CCsummaryPDF(control As IRibbonControl)
Dim PdfFilename As Variant
Sheets("SUMMARY-Cupcakes Information").Select
Range("A1").Select
PdfFilename = Application.GetSaveAsFilename( _
InitialFileName:="CustomerName_CupcakeSummary", _
FileFilter:="PDF, *.pdf", _
Title:="Save As PDF")
If PdfFilename <> False Then
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.PrintArea = "$C$1:$H$24"
.PrintTitleRows = ActiveSheet.Rows(13).Address
.Zoom = False
.FitToPagesTall = False
.FitToPagesWide = 1
End With
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=PdfFilename, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=False, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=True
End If
End Sub
I went on and left the option to open after creating False because it is better than having the weird blank screen open, but I would like the option to open the PDF after creating it to work.
I have the full version of Adobe Acrobat on my computer, but Microsoft Edge is the window that opens when creating the PDF. Is there a way to default it to Adobe?