+ Reply to Thread
Results 1 to 6 of 6

export single page to pdf

  1. #1
    Registered User
    Join Date
    08-27-2015
    Location
    minnesota
    MS-Off Ver
    2013
    Posts
    11

    export single page to pdf

    Sub export()
    '
    ' export Macro
    '

    '
    Sheets("Purchase Order Request").Select
    Sheets("Purchase Order Request").Copy
    ActiveWindow.SmallScroll Down:=9
    ActiveWorkbook.SaveAs Filename:= _
    "https://75f.sharepoint.com/Support/Shared Documents/Orders_Inventory/Purchase Orders/Book2x2.xlsx" _
    , FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False

    Windows("Inventory Count.xlsm").Activate
    End Sub

    the red is where i am having issues. I want to be able to use this macro multiple times so the title of the save as copy needs to be based on what is in f4 of the worksheet. I am not sure how to write that though....

    so basically
    I am exporting a worksheet to a new excel doc then saving as to a pdf file. the title of the pdf file save as needs to be the same information that is in the f4 cell. is there hope?

  2. #2
    Valued Forum Contributor
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Office 365 ProPlus
    Posts
    853

    Re: export single page to pdf

    Please be sure to use [ CODE ] tags on future posts

    Give this a shot. There is no need to export it to a new workbook first. You can just save/print the single sheet to a PDF file. The below will save the activesheet to a pdf file of your directory and file name of choice.

    EDIT. I missed part of your post. But you can probably set the variabled pdfName to value in Cell F4 if you would like, hardcode the path to your sharepoint site possibly.

    I'm not sure on the ability to save direct to sharepoint and if need any special permissions for that. Hopefully someone else can chime in on that.

    Please Login or Register  to view this content.
    Last edited by ptmuldoon; 08-27-2015 at 03:59 PM.

  3. #3
    Registered User
    Join Date
    08-27-2015
    Location
    minnesota
    MS-Off Ver
    2013
    Posts
    11

    Re: export single page to pdf

    Please Login or Register  to view this content.

    So i am still learning on macros and tried the code i keep getting run time error 76 the path not found i was trying the http sharepoint path at first then went to try a local path and it still gives the message. I know im doing something silly but Im lost.

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,516

    Re: export single page to pdf

    You forgot the "\"

  5. #5
    Registered User
    Join Date
    08-27-2015
    Location
    minnesota
    MS-Off Ver
    2013
    Posts
    11

    Re: export single page to pdf

    Please Login or Register  to view this content.
    So i got that figured out but now the code get to the sharepoint file and has the save window open with the correct title. at this point i want it to save by itself and open the new pdf file as well. it is making me manually hit save and then this printer thing pops up?

    Capture.PNG


  6. #6
    Registered User
    Join Date
    08-27-2015
    Location
    minnesota
    MS-Off Ver
    2013
    Posts
    11

    Re: export single page to pdf

    Reset my computer and made a few changes it works for the most part still isnt saving automatically but i can live with that.


    Thanks!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Setting page margins on a single page vs entire sheet
    By Radar(23) in forum Excel General
    Replies: 0
    Last Post: 01-23-2015, 10:39 AM
  2. Export single sheet as CSV?
    By Daniel86 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-10-2013, 02:18 AM
  3. How do I change page orientatin of a single page?
    By Bern80 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 12-28-2012, 01:06 PM
  4. Export matrix to single text
    By Kb24 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-05-2009, 01:27 PM
  5. Export single sheet in csv format?
    By bluefrog in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-08-2008, 06:55 AM
  6. Replies: 4
    Last Post: 12-17-2007, 08:11 AM
  7. [SOLVED] export a single row to word
    By Sketch in forum Excel General
    Replies: 1
    Last Post: 05-15-2005, 05:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1