Excel VBA - Error handling problem

  • Thread starter Thread starter brutalmetal
  • Start date Start date
B

brutalmetal

Hi,

I am using centralized error handling in my VB program whic
manipulates excel sheets.

My question is this:

I have a function which I call whenever a run time error is detected


I open a file in my main code.
The main code calls other subroutines.
When a run time error is detected, the error handling function i
called.
The erro handling function displays an appropraite message and has th
"End" statement.
I expect the end statement to close all files that were opened in th
program. But it turns out that it only closes files opened in th
sub/function where the error occured.

Can anyone please tell me how I make sure all files opened durin
program execution are closed.

Thanks!
BrutalMeta
 
Back
Top