+ Reply to Thread
Results 1 to 6 of 6

Export Specified Worksheets to PDF

  1. #1
    Registered User
    Join Date
    04-23-2013
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    37

    Export Specified Worksheets to PDF

    I am looking for a solution similar to the one in this thread.

    http://www.excelforum.com/excel-prog...orksheets.html

    Only difference is I need to export to PDF. I have attempted to modify the code provided with no luck.

    Thanks,

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Export Specified Worksheets to PDF

    Hi, dmarzean,

    maybe have a look at this code (based on the thread you linked):
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    04-23-2013
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    37

    Re: Export Specified Worksheets to PDF

    Getting same error as when I tried to modify.

    Method 'Copy' of '_Worksheet' failed

    This line highlighted wsCurrent.copy

    How would I modify to use a cell value and nothing to do with the sheet name?

  4. #4
    Registered User
    Join Date
    04-23-2013
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    37

    Re: Export Specified Worksheets to PDF

    When I run the code from the other post I get same error on this line Sheets(strSheetname).Copy

    My Modifications in rep

    Please Login or Register  to view this content.

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Export Specified Worksheets to PDF

    Hi, dmarzean,

    a guess: is the sheet visible if you want to copy it?

    Ciao,
    Holger

  6. #6
    Registered User
    Join Date
    04-23-2013
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    37

    Re: Export Specified Worksheets to PDF

    Well, I feel like an idiot. Didn't even look at my hidden sheets to exclude.

    Your code works perfect!

    Thank you Sir.

+ 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. Export Specified Worksheets
    By HangMan in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-19-2014, 01:45 PM
  2. Export Multiple Worksheets to CSV
    By dleininger in forum Excel General
    Replies: 2
    Last Post: 06-23-2013, 02:23 PM
  3. Replies: 1
    Last Post: 10-30-2012, 06:34 PM
  4. Export worksheets
    By mjhopler in forum Excel General
    Replies: 2
    Last Post: 06-14-2010, 01:02 PM
  5. XML Export and worksheets
    By WHoit in forum Excel General
    Replies: 0
    Last Post: 03-15-2005, 07:06 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