ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   file removal before Excel closing (https://www.excelbanter.com/excel-programming/346823-file-removal-before-excel-closing.html)

Jean-Luc CAPEL

file removal before Excel closing
 
Hi,

Here is an academic case.
I have two Workbooks :
the first contain datas,
the second contain program modules.

When the application close :
I close the data workbook,
then I remove this workbook on the hard disk,
and finally, if there are not other opened Workbook, I leave Excel, if not
to close the program workbook.

This Closing can occur:
either by the Click on a button "To leave" of a personalized toolbar
affected with a subroutine of my program workbook,
or by closing data workbook (File/ Close or Cross [ X ] window of the data
workbook)
or finally by closing of Excel (File/ Quit or Cross [ X ] window of Excel)

In the two1st cases, I manage in VBA to remove the data file of my disc.
In the last case, Excel automatically gives the hand to the event of closing
of the programs workbook before that of the data workbook, which prevents me
from removing the data workbook on the hard disk.

In short, there is you a solution to reverse the events of closing of the
workbook when Excel is left?

Thank you for your answers and/ or suggestions.
JLuc




All times are GMT +1. The time now is 01:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com