+ Reply to Thread
Results 1 to 7 of 7

If PDF backup file already exist dont resave pdf backup when file is opened to view

  1. #1
    Registered User
    Join Date
    02-19-2012
    Location
    Indiana, USA
    MS-Off Ver
    Excel 2007
    Posts
    24

    If PDF backup file already exist dont resave pdf backup when file is opened to view

    I have searched web and put some things in my workbook to get 1. the origional to save to one location 2. save a backup file to a backup folder and put date and time after to keep old file if changes are made. 3. export a file as pdf to a different location.

    I have been looking at the "if file exist" stuff and would like to have a code look at the pdf's and if the filename already exist, do nothing. Only save the pdf the first time the file is closed and no additional pdf's (resaves/overwrites) to save after the first one.

    Below is what i have copied and pasted to get it where it is now but not sure where to go next... I would take out the MM-DD-YYYY HHMM at the end of the pdf name so it will show up as the same name of course after adding to do nothing if the pdf exist.

    The Pdf is to show the file as it was when it was closed after the shift. We have to send the pdf out in email so doing it my way below just clutters up the pdf folder if people look at the logs and it resaves the same thing, changes or not. We would then have to go through and pick out only the original/first log to attach to the email, instead of being able to just copy down the list and paste.

    Any Help would be Great, Thanks!

    Please Login or Register  to view this content.
    Last edited by smalltime06; 02-27-2012 at 09:30 PM.

  2. #2
    Registered User
    Join Date
    02-19-2012
    Location
    Indiana, USA
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: If PDF backup file already exist dont resave pdf backup when file is opened to vi

    So, just read my post and not sure if the question is clear... Would like code to look in the pdf folder to see if a file by the same name is there, upon exit/close.

    If so, then do nothing and continue with other saves doing nothing to pdf folder.

    If NOT - no file(pdf) by the same name then continue with the "ActiveSheet.ExportAsFixedFormat xlTypePDF,..."

    Thanks
    Last edited by smalltime06; 02-27-2012 at 09:31 PM.

  3. #3
    Registered User
    Join Date
    02-19-2012
    Location
    Indiana, USA
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: If PDF backup file already exist dont resave pdf backup when file is opened to vi

    Anyone? I searched and tried several things last night and couldnt get it right.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: If PDF backup file already exist dont resave pdf backup when file is opened to vi

    Maybe like so:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Registered User
    Join Date
    02-19-2012
    Location
    Indiana, USA
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: If PDF backup file already exist dont resave pdf backup when file is opened to vi

    Still overwrites the pdf. I copied your code and it still saved with date and time, so I then took out the date and time from code and it saved without the D/T but when I would open, change the file and close; it would just replace the pdf with the newest version.

  6. #6
    Registered User
    Join Date
    02-19-2012
    Location
    Indiana, USA
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: If PDF backup file already exist dont resave pdf backup when file is opened to vi

    Dont know how to do it obviously but would need it to look in "I:\Surveillance\Surv LOGS\Backup Files\PDFlogs\" to see if the activeworkbook.name.xlsm.pdf matches any file in that folder. If so skip to next (do nothing) .

    If not then
    Please Login or Register  to view this content.
    Last edited by smalltime06; 02-28-2012 at 04:40 PM.

  7. #7
    Registered User
    Join Date
    02-19-2012
    Location
    Indiana, USA
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: If PDF backup file already exist dont resave pdf backup when file is opened to view

    Still looking for some help on this one please...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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