+ Reply to Thread
Results 1 to 2 of 2

Have macro over write existing file from control button if file exist

  1. #1
    Forum Contributor
    Join Date
    05-12-2009
    Location
    Hendersonville, TN
    MS-Off Ver
    Excel 2010
    Posts
    113

    Question Have macro over write existing file from control button if file exist

    Greetings all,

    I am very close to finishing my project, but I need to address an issue with my macros for when it has previously been run and the resulting files exist.

    I have a excel sheet which is populated by the user, then the command button linked to the macros is pressed to process. The macros run one after the other to: Create and name a file folder, save the worksheet in the new folder with the same name as the newly created folder; creates a MS Word merge document and names and saves to the afore mentioned folder.

    My issue is that the users want to be able to overwrite the newly created files within the folder if they make a correction and resubmit the data via the control button. In essence, they want the whole process to run again and overwrite anything that is of the same file name. How can this be done? If so can it be done without getting error messages?

    Here are the 2 macros I am working with:

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Thank you in advance for any help you may be able to provide. Without the help I have already received from folks on this site, I would have never been able to get as far with this project as I have.


    Patrick

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Have macro over write existing file from control button if file exist

    You can probably get away with:

    Please Login or Register  to view this content.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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