+ Reply to Thread
Results 1 to 2 of 2

Error checking code that will prevent over-writing of a workbook when saving to PDF

  1. #1
    Registered User
    Join Date
    02-21-2011
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    66

    Error checking code that will prevent over-writing of a workbook when saving to PDF

    Hi all,

    OK one way or another through a collaborative effort at work we've managed to create a macro that loops through a list of users, creates a PDF of specific pages in a workbook that they need, save a copy of the PDF whilst also creating an email ready to send to the user.

    Last few steps are error checking. Does anyone know what to put (and where) in to the attached coding to
    a) create an error message if the Tab Names and Headings in C1:P1 don't match exactly (as they are required to do in order to print off the correct pages)
    b) stop the macro over-writing a file already saved at the:
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:=FullName _
    , IncludeDocProperties:=False, IgnorePrintAreas:=False, OpenAfterPublish:=False
    part of the code?

    A lot of it has been blind luck and hatchet coding, so if you have a better way of doing this completely or any tips to make the code more dynamic please feel free to share, have to get better somehow?!

    Many thanks in advance,

    Mike
    Attached Files Attached Files

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Error checking code that will prevent over-writing of a workbook when saving to PDF

    Is this solved?

    If you solve a problem yourself before anyone else has responded, please take a moment to describe your solution, chances are some other member will benefit.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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