Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Macro
I need to create a macro in excel that prints out multiple reports in
pdf format. Is there a way to hardcode the pdf file name so the save as message box doen't appear?? Thanks --- Message posted from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Macro
The following will save the file as you specify, not sure about the .pdf
format your require, but the message box will be suppressed Application.DisplayAlerts = False Workbook.SaveAs Filename:="path\filename" Application.DisplayAlerts = True "bstruchen" wrote in message ... I need to create a macro in excel that prints out multiple reports in pdf format. Is there a way to hardcode the pdf file name so the save as message box doen't appear?? Thanks --- Message posted from http://www.ExcelForum.com/ ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =--- |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Macro
Thanks for your help.
I wrote a macro see below. The problem is it only prints in black and white and I need color. Any ideas !!! Sub Brian() ' ' PrintPDF2 Macro ' Macro recorded 12/16/2003 by bjstruch ' Dim PSFileName As String Dim PDFFileName As String Dim DistillerCall As String Dim ReturnValue As Variant 'Local folder to hold PSFileName and PDFFileName PSFileName = "C:\temp\Brian.PS" PDFFileName = "C:\temp\Brian.PDF" 'If exist then delete If Dir(PSFileName) < "" Then Kill (PSFileName) If Dir(PDFFileName) < "" Then Kill (PDFFileName) SendKeys PSFileName & "{ENTER}", False 'This is where you set the active area Application.Goto Reference:="TBLBDGR" ActiveSheet.PageSetup.PrintArea = "$M$75:$S$131" ActiveSheet.PrintOut , printtofile:=True 'Add " " to file names [Chr(34) = "] PSFileName = Chr(34) & PSFileName & Chr(34) PDFFileName = Chr(34) & PDFFileName & Chr(34) 'Call .exe to writ PS file to PDF format DistillerCall = "C:\Program Files\Adobe\Acrobat 5.0\Distillr\Acrodist.exe" & _ " /n /q /c" & PDFFileName & " " & PSFileName '" /n /q /o" 'If the application doesn't open correctly let us know about it ReturnValue = Shell(DistillerCall, vbNormalFocus) If ReturnValue = 0 Then MsgBox "Creation of" & PDFFileName & "failed." ' End Sub --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
passing variables from an excel macro to a powerpoint macro | Excel Programming |