Jump to content


Photo

printing a Hyperlinked PDF as part of a macro

printing pdf

  • Please log in to reply
6 replies to this topic

#1 Alex McL

Alex McL

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 06 January 2016 - 05:13 PM

Hi, I have created a macro which prints each of the sheets in my workbooks and on several of the sheets I have hyperlinks which open a PDF. I presently then manually print the PDF and close the PDF at which point the macro commences. I just cannot figure out how to get it to automatically print, then close the PDF. Any ideas would be greatly appreciated

Thanks

Alex



#2 Jonathan

Jonathan

    Forums Administrator

  • Administrators
  • 843 posts

Posted 06 January 2016 - 07:49 PM

Hi Alex,

 

If you are printing to PDF using Adobe PDF Writer, the setting that determines whether PDF files are opened after printing can be found within the printer settings. If you configure the PDF printer not to open the file after printing, you should work around this problem.

 

If you're using Excel's Save As dialog to save as PDF, you'll find the option within the dialog:

 

PrintPDF.png

 

For more on saving Excel files to PDF, see the video lesson: Essential Skills Lesson 1-7 Understand common file formats.

 

If you disable the option to open the PDF after printing, it should resolve the problem.

 

Please feel free to reply if you have any more questions about this.


Jonathan is part of the professional team who answer Excel-related questions posted on the ExcelCentral.com forums.
Jonathan also tests our courses prior to publication and has worked on all of our ten world bestselling Excel books for Excel 2007, Excel 2010, Excel 2013, Excel 2016 for Windows and Excel 2016 for Apple Mac. Jonathan has also worked on over 850 video lessons for or video courses covering Excel 2007, Excel 2010 and Excel 2013.
As well as extensive Excel knowledge, Jonathan has worked in the IT world for over thirteen years as a programmer, database designer and analyst for some of the world's largest companies.


#3 Alex McL

Alex McL

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 14 January 2016 - 10:08 AM

HI I don't think I explained myself fully. I have a macro that prints the sheets within a workbook. some of these sheets only have a hyperlink to a PDF document which I can get to open but then I manually have to print them and return to the macro to print the rest of the sheets. I want to automate the printing of the PDF(I don't need to open it

Thanks

Alex

 



#4 Jonathan

Jonathan

    Forums Administrator

  • Administrators
  • 843 posts

Posted 14 January 2016 - 07:50 PM

Hi Alex,

 

Unfortunately, Excel macros are only capable of working within Excel so you won't be able to record a macro that affects other programs (such as the PDF reader).

 

An alternative solution might be to extract the hyperlinks from the Excel documents and then print them from within your PDF reader. The full version of Adobe Acrobat is capable of batch printing PDFs, but other programs may not have this capability.


Jonathan is part of the professional team who answer Excel-related questions posted on the ExcelCentral.com forums.
Jonathan also tests our courses prior to publication and has worked on all of our ten world bestselling Excel books for Excel 2007, Excel 2010, Excel 2013, Excel 2016 for Windows and Excel 2016 for Apple Mac. Jonathan has also worked on over 850 video lessons for or video courses covering Excel 2007, Excel 2010 and Excel 2013.
As well as extensive Excel knowledge, Jonathan has worked in the IT world for over thirteen years as a programmer, database designer and analyst for some of the world's largest companies.


#5 Alex McL

Alex McL

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 25 January 2017 - 12:42 PM

Hi Jonathan,

I have returned to this after a while away. A macro can open adobe and print it, and I have nearly got there but cant get it to find the file. I assume its something to so with relative and absolute addresses.

 

using a shell command I can open adobe but when it tries to open the cell reference (which is a hyperlink) it says file not found



#6 Jonathan

Jonathan

    Forums Administrator

  • Administrators
  • 843 posts

Posted 25 January 2017 - 09:48 PM

Hi Alex,

 

It sounds like you're talking about VBA programming rather than Excel macros. VBA programming is used to extend Excel's functionality beyond its built-in features.

 

We can only offer non-VBA solutions on these forums (see our forum rules), so we can't offer programming assistance.

 

Please let me know if I'm misunderstanding and you are using a recorded macro or another feature of Excel and I will try to offer further advice.


Jonathan is part of the professional team who answer Excel-related questions posted on the ExcelCentral.com forums.
Jonathan also tests our courses prior to publication and has worked on all of our ten world bestselling Excel books for Excel 2007, Excel 2010, Excel 2013, Excel 2016 for Windows and Excel 2016 for Apple Mac. Jonathan has also worked on over 850 video lessons for or video courses covering Excel 2007, Excel 2010 and Excel 2013.
As well as extensive Excel knowledge, Jonathan has worked in the IT world for over thirteen years as a programmer, database designer and analyst for some of the world's largest companies.


#7 Alex McL

Alex McL

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 26 January 2017 - 11:40 AM

Johnathan,

I am writing the code in a macro never thought of VBA and macros being different, but I suppose it will be classed as VBA






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users