+ Reply to Thread
Results 1 to 2 of 2

VBA Prompt to close PDF so file can be overwrtitten or close automatically

  1. #1
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    VBA Prompt to close PDF so file can be overwrtitten or close automatically

    Currently I am saving a PDF to a folder and it looks to see if that file had already been saved to that folder. If that file exists it asks if you would like to overwrite. The Problem I have is if you enter anything other 'Y' it will create the new file : How would I add that if they choose to hit cancel then it cancels?

    Yes = Overwrite file / No = Makes the new time stamped file already in code/ Cancel = Exits entirely.

    Also, this is the big issue

    If the user chooses to overwrite the PDF and by chance the user had that PDF open you get a runtime error because the file is open until the user manually closes the file.

    Is it possible that after it knows the file exists and it prompts if you want to overwrite & if you choose overwrite then it makes sure the PDF is closed so it can overwrite eliminating the user from having to close the file manually

    If it can't close automatically then could is show message box that says "the PDF seams to be open can not overwrite please close PDF and rerun." then exit

    That way they would not get the run-time error saying could not save..... People see run time error and automatically stop trying

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: VBA Prompt to close PDF so file can be overwrtitten or close automatically

    I used and it worked
    Please Login or Register  to view this content.
    I then just used
    Please Login or Register  to view this content.
    to make it happen

+ 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. automatically close file and save changes with a new name
    By 2funny4words in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-25-2009, 10:07 PM
  2. Auto close, save to new file without prompt
    By Bafa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-09-2007, 10:31 AM
  3. [SOLVED] Intercepting the file save prompt before close?
    By Neil Bhandar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-13-2006, 11:20 PM
  4. [SOLVED] Close file automatically
    By Lee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-02-2005, 06:20 PM
  5. [SOLVED] CLOSE ALL macro for XL2K (but with prompt to save for each file)?
    By StargateFan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2005, 10:05 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