+ Reply to Thread
Results 1 to 7 of 7

Convert range to PDF and save

  1. #1
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    430

    Convert range to PDF and save

    Good Afternoon all

    I'm trying to convert and save a variable range, Worksheet "Data" row "R1: Z" into a PDF file, I have been trying the code below, however when I run it I'm receiving runtime error and message "Document Not Saved" with the last 4 lines of code highlighted in yellow

    Could someone please point out where I am going wrong

    Appreciated

    jim


    Please Login or Register  to view this content.
    Last edited by JamesT1; 08-16-2023 at 06:02 PM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: Convert range to PDF and save

    Try changing the "/" to "-" in the date part and possibly the ":" needs to change as well

  3. #3
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    430

    Re: Convert range to PDF and save

    Thanks Dave

    Still getting the same results

    Jim

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Convert range to PDF and save


    So somewhat bad within the path and / or the filename, easy to solve just activating the Macro Recorder and operating manually …

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Re: Convert range to PDF and save


    Another thing which could be wrong :
    what is the active worksheet according to the missing worksheet of Cells(Rows.Count, "R").End(xlUp) ?!

  6. #6
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    430

    Re: Convert range to PDF and save

    Evening all

    This isn't working because of the file 'FName' name but I can't figure out why this isn't working

    If I only use the date and time, it works well,, correct path, correct range and names the file with the date and time
    Please Login or Register  to view this content.
    As soon as I reference a cell it stops working,, even if I only use the cell ref without the date and time

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    430

    Re: Convert range to PDF and save

    I've figured it out

    Its the contents of the refence cell..... It has ":" in it and I didn't notice it,,, this caused the issue...

    Many thanks for your help earlier guys

    Regards

    jim

+ 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. Save/convert Excel to Word
    By doylzer in forum Excel General
    Replies: 2
    Last Post: 11-02-2022, 10:27 AM
  2. Convert Range to HTML, then paste to Word, then Save as PDF
    By Lee_of_Excel in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-07-2021, 12:28 AM
  3. [VBA] Save Range as picture, save to file, attach to email
    By Armitage2k in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-23-2018, 07:34 AM
  4. [SOLVED] Problems with Vba to save file & convert to PDF
    By si_1970 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-17-2016, 03:32 PM
  5. [SOLVED] VBA - Open Save As dialogue box - to save named range
    By Jabba69 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-10-2014, 10:34 AM
  6. Convert and save as current name
    By martinez77 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-07-2013, 03:09 PM
  7. Convert formulas to values on save
    By Steve B in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-12-2005, 05:25 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