+ Reply to Thread
Results 1 to 6 of 6

Saving Worksheet to PDF using VBA

  1. #1
    Forum Contributor
    Join Date
    04-07-2015
    Location
    Halifax, NS
    MS-Off Ver
    365
    Posts
    100

    Saving Worksheet to PDF using VBA

    Hello again.
    I am trying to archive data on a sheet by saving as a pdf file. I have tried 2 different blocks of code and in both cases, the pdf file was created in the predetermined location with the correct file name, however the file was blank. The code did not copy the data.
    The first code I used was.

    Please Login or Register  to view this content.

    The second code I tried was something I found on a tutorial site.

    Please Login or Register  to view this content.

    Both scenarios resulted in a blank pdf. Any suggestions?
    Proud to be Canadian!

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Saving Worksheet to PDF using VBA

    after very quickly reading results here:

    https://www.google.com/search?q=vba+...pdf+file+blank

    I would bet more than anything that some of those would fix the issue. but not sure. check them out perhaps? a very wise person answered someone else here:

    https://stackoverflow.com/questions/...as-blank-pages


    additional info:

    https://docs.microsoft.com/en-us/off...tasfixedformat

    https://docs.microsoft.com/en-us/off...ixedformattype

  3. #3
    Forum Contributor
    Join Date
    04-07-2015
    Location
    Halifax, NS
    MS-Off Ver
    365
    Posts
    100

    Re: Saving Worksheet to PDF using VBA

    Thanks. I'll have a look and see what I can find out.

  4. #4
    Forum Contributor
    Join Date
    04-07-2015
    Location
    Halifax, NS
    MS-Off Ver
    365
    Posts
    100

    Re: Saving Worksheet to PDF using VBA

    I had a look at the links you suggested and you were right, they were very useful. My issue was resolved by setting the print range and adding to the ExportAs line.
    Please Login or Register  to view this content.
    Thanks again!

  5. #5
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Saving Worksheet to PDF using VBA

    ha ha ha. what a rare case. I'm never right. good for you! =) see ya later.

  6. #6
    Forum Contributor
    Join Date
    04-07-2015
    Location
    Halifax, NS
    MS-Off Ver
    365
    Posts
    100

    Re: Saving Worksheet to PDF using VBA

    Thanks for the warning. lol

+ 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. [SOLVED] Is it possible to auto-update a worksheet while saving data on another worksheet?
    By saj_72 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-29-2017, 08:52 AM
  2. [SOLVED] saving worksheet as pdf
    By swfarm in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-31-2017, 04:01 PM
  3. Saving each worksheet as a separate file (starting from a particular worksheet)
    By AndrewWheeler87 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-01-2014, 04:39 PM
  4. [SOLVED] Saving worksheet using a macro. Problem is that it is saving more rows than it needs to
    By Kammphoto in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-04-2013, 10:09 AM
  5. saving worksheet
    By georgejan in forum Excel General
    Replies: 1
    Last Post: 03-23-2011, 06:02 PM
  6. Replies: 9
    Last Post: 01-07-2009, 09:02 AM
  7. [SOLVED] Saving a Worksheet
    By GoBucks in forum Excel General
    Replies: 3
    Last Post: 01-27-2005, 04: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