Suppose you have a macro that creates a report in a new workbook. You want this report to always be saved to the same path with the same name. If there is an existing report from last time you want the newly created report to overwrite this without any prompt. So far, so easy.
Now to ramp it up a little.
What if the previously saved report is currently open in Excel? How can you ensure that the previous report will be overwritten/deleted by the new report without any prompt?
I'm not sure how much harder this will make it but what if the previously saved report is currently open in another instance of Excel?
Doable?
Desired Outcomes
- Save workbook in predefined location & filename (I can do this)
- If file already exists (and is closed) overwrite it without any prompt (I can do this)
- If file already exists and is open in current Excel instance - overwrite (or delete the old/open version then save the new report) without prompt
- If file already exists and is open in another Excel instance - overwrite (or delete the old/open version then save the new report) without prompt
Bookmarks