troubleshooting Question

Macro to delete and replace Excel file

Avatar of KLM56
KLM56 asked on
Microsoft ExcelVisual Basic Classic
25 Comments1 Solution488 ViewsLast Modified:
Hi guys,

I have an update button on a userform. When the user clicks this button it opens another workbook called update.xlsm. Once the update.xlsm opens, I have a macro in that workbook that closes the original workbook. This works great. Now I am trying to figure out, how I can add to the macro to delete the previous closed workbook, and replace that file with a fresh copy of the workbook stored on our network drive. Once the file is copied I want it to open and then close the update.xlsm workbook.

I am not sure how the macro will determine where the file to be deleted is located. Users save the file to any location they choose. When they click update, that file should be replaced regardless of location.

Any help on this will be greatly appreciated.
ASKER CERTIFIED SOLUTION
scsyme

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 25 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 25 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros