Create a print to pdf macro to use on multiple pcs RRS feed

  • Question

  • I am creating an excel document for my company and would like to create a "print to pdf" button for anyone to use.  I can create the macro on my pc with no problems, however it will not work on other pcs because the file paths are not valid.

    This is what I want to achieve

    Any user can click the "print" icon in the spreadsheet

    This print button will create a pdf of pages 26 & 27 of the workbook saved on their desktop.

    Thursday, January 12, 2017 9:12 PM

All replies

  • Hi,

    As I understood, all you want to find a VBA code, which can give you a path of Desktop in any PC for any user logged in?

    Here is that magical statement which will give you the correct path of desktop:

    desktopPath = Environ("USERPROFILE") & "\Desktop"

    Let me know if this exactly was your question?

    Vish Mishra

    Friday, January 13, 2017 4:31 AM