Impression régulière sur Adobe PDF à partir d'Excel, script pour obliger les files PDF à être enregistrés dans le path correct

Je travaille sur une série de files XLS dans Excel. Quand j'ai fini avec eux, j'ai besoin de les imprimer au format PDF afin qu'ils puissent être transmis à une fête à l'extérieur de mon cabinet.

J'ai enregistré une macro assez basique pour me permettre d'imprimer ces files avec le même réglage à chaque fois. Malheureusement, il ne fait pas tout ce dont j'ai besoin pour faire.

Fondamentalement, je souhaite que Adobe me request où le file doit être enregistré lorsqu'il est imprimé. Cela ne se déroule pas maintenant avec mon script. Si j'imprime manuellement et select les parameters "Demander de replace le file PDF existant" de la window properties de l'imprimante dans Excel, il me request toujours où le file doit être sauvegardé. Mon script ne prend pas cela, mais je ne suis pas sûr de ce qu'il faut append.

J'ai beaucoup de files à parcourir (et c'est une tâche qui se reproduira), donc plus tôt je ferais mieux de décrire.

Est-ce quelque chose que je peux aborder avec ma macro Excel, et si oui, quelqu'un peut-il me diriger dans la bonne direction?

Sub PrintToAdobeRedactions() ' ' PrintToAdobeRedactions Macro ' Print redacted worksheets to Adobe with correct settings every time. ' ' Keyboard Shortcut: Ctrl+e ' Application.PrintCommunication = False With ActiveSheet.PageSetup .PrintTitleRows = "" .PrintTitleColumns = "" End With Application.PrintCommunication = True ActiveSheet.PageSetup.PrintArea = "" Application.PrintCommunication = False With ActiveSheet.PageSetup .LeftHeader = "" .CenterHeader = "[Tab]" .RightHeader = "" .LeftFooter = "" .CenterFooter = "Page [Page]" .RightFooter = "" .LeftMargin = Application.InchesToPoints(0.75) .RightMargin = Application.InchesToPoints(0.75) .TopMargin = Application.InchesToPoints(1) .BottomMargin = Application.InchesToPoints(1) .HeaderMargin = Application.InchesToPoints(0.5) .FooterMargin = Application.InchesToPoints(0.5) .PrintHeadings = False .PrintGridlines = False .PrintComments = xlPrintSheetEnd .PrintQuality = 600 .CenterHorizontally = False .CenterVertically = False .Orientation = xlLandscape .Draft = False .PaperSize = xlPaperLetter .FirstPageNumber = xlAutomatic .Order = xlOverThenDown .BlackAndWhite = False .Zoom = 100 .PrintErrors = xlPrintErrorsDisplayed .OddAndEvenPagesHeaderFooter = False .DifferentFirstPageHeaderFooter = False .ScaleWithDocHeaderFooter = True .AlignMarginsHeaderFooter = False .EvenPage.LeftHeader.Text = "" .EvenPage.CenterHeader.Text = "" .EvenPage.RightHeader.Text = "" .EvenPage.LeftFooter.Text = "" .EvenPage.CenterFooter.Text = "" .EvenPage.RightFooter.Text = "" .FirstPage.LeftHeader.Text = "" .FirstPage.CenterHeader.Text = "" .FirstPage.RightHeader.Text = "" .FirstPage.LeftFooter.Text = "" .FirstPage.CenterFooter.Text = "" .FirstPage.RightFooter.Text = "" End With Application.PrintCommunication = True ActiveWorkbook.PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False End Sub 

Pour save un PDF:

 Sub SaveAsPDF() Dim SaveName as Ssortingng SaveName = InputBox("Save As File Name?") ThisWorkbook.ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:=Application.ActiveWorkbook.Path & Application.PathSeparator & SaveName & ".pdf", _ Quality:=xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=True End Sub