ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel cores when trying to close a workbook after exporting+removing VBA modules (https://www.excelbanter.com/excel-programming/397768-excel-cores-when-trying-close-workbook-after-exporting-removing-vba-modules.html)

Tom Med

Excel cores when trying to close a workbook after exporting+removing VBA modules
 
I have a utility class in an 'addin' that listens for onClose and Save
events on worksheets. If a flag is set when the sheet is closed all
the modules are exported to a repository and then the file is saved
with no modules loaded.

However this removing of modules followed by a call to close the
spreadsheet core's excel in the VBA. This is probably due to VBA
still having hooks into functions that have now been removed.

Is there anyway to refresh VBA's view of what is loaded and what is
not? I have tried inserting onTime events to fire the close of the
worksheet momentarily after it is exported, but this still causes
problems.

Is there anyway to find the cause of these numerous core's? Or does
anyone know a way to update the internal caches of VBA as to what is
loaded and what is not?

Many Thanks

Tom



All times are GMT +1. The time now is 09:12 AM.

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