ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Application on error sub possible ? (https://www.excelbanter.com/excel-programming/301216-application-error-sub-possible.html)

Mike Iacovou

Application on error sub possible ?
 
Hi all,

Many thanks in anticipation.
I have some VBA running with application.Visible = False .
While everything works fine, and errors are unlikely - they are still possible.
Is there a means of setting a global "on error" command such that the application will be made visible again - otherwise it will stall invisibly.
Many thanks :)

Mike

Frank Kabel

Application on error sub possible ?
 
Hi
maybe something like
sub foo()
application.Visible = False
on error goto errhandler
'your code
exit sub

errhandler:
application.Visible = True
end sub


--
Regards
Frank Kabel
Frankfurt, Germany


Mike Iacovou wrote:
Hi all,

Many thanks in anticipation.
I have some VBA running with application.Visible = False .
While everything works fine, and errors are unlikely - they are still
possible.
Is there a means of setting a global "on error" command such that the
application will be made visible again - otherwise it will stall
invisibly. Many thanks :)

Mike



Mike Iacovou

Application on error sub possible ?
 
Many thanks Frank. I'll try that out... I'm sure it will work perfectly ;)

"Frank Kabel" wrote:

Hi
maybe something like
sub foo()
application.Visible = False
on error goto errhandler
'your code
exit sub

errhandler:
application.Visible = True
end sub


--
Regards
Frank Kabel
Frankfurt, Germany


Mike Iacovou wrote:
Hi all,

Many thanks in anticipation.
I have some VBA running with application.Visible = False .
While everything works fine, and errors are unlikely - they are still
possible.
Is there a means of setting a global "on error" command such that the
application will be made visible again - otherwise it will stall
invisibly. Many thanks :)

Mike





All times are GMT +1. The time now is 12:29 PM.

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