+ Reply to Thread
Results 1 to 3 of 3

Prevent overwriting when saving as pdf

  1. #1
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,841

    Prevent overwriting when saving as pdf

    I'm using a sligthly modified version of this code here: http://www.contextures.com/excelvbapdf.html
    to save a worksheet as pdf.
    The problem is:
    If a pdf with that name already exists it doesn't ask, it just overwrites.

    How can this be fixed?
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Prevent overwriting when saving as pdf

    Add the code in red where indicated.
    Please Login or Register  to view this content.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,841

    Re: Prevent overwriting when saving as pdf

    It turns out the problem was a bit different and I managed to solve it.
    Nevertheless, I was also wondering how I could check if a file existed. Now I know, 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. How do I prevent Macro from overwriting data
    By MooseAUH in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-05-2013, 09:04 PM
  2. lock Subtotals to prevent overwriting.
    By gruf1968 in forum Excel General
    Replies: 1
    Last Post: 03-12-2010, 07:01 PM
  3. Automatically enter date and time on clicking/prevent overwriting
    By nitinjoshi123 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-27-2009, 05:28 PM
  4. Prevent overwriting cells
    By MGT2000 in forum Excel General
    Replies: 0
    Last Post: 10-29-2008, 02:11 PM
  5. Prevent overwriting file...
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-11-2008, 11:47 AM
  6. How to prevent overwriting of file ?
    By asitagrawal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-25-2008, 10:23 AM
  7. Prevent user from overwriting file
    By peter.thompson in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-14-2006, 08:35 AM
  8. Replies: 5
    Last Post: 11-24-2005, 11:15 AM

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