ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   What Range was Missing (https://www.excelbanter.com/excel-programming/410272-what-range-missing.html)

Mike H.

What Range was Missing
 
If I issue this command:
application.goto Reference:="MyRange"
and the named range "MyRange" does not exist, is there a way to
programatically pick up the name of the range that the error failed on. I am
using error handling and my initial idea was to place a line above the
command: referencename="MyRange", but if I missed doing this I'd get the
wrong message in my error handling area. So that is the reason for this
question.

Jeff Johnson[_2_]

What Range was Missing
 
"Mike H." wrote in message
...

If I issue this command:
application.goto Reference:="MyRange"
and the named range "MyRange" does not exist, is there a way to
programatically pick up the name of the range that the error failed on. I
am
using error handling and my initial idea was to place a line above the
command: referencename="MyRange", but if I missed doing this I'd get the
wrong message in my error handling area. So that is the reason for this
question.


The method you're using is the correct one, and yes, it does place the onus
on you to make sure that you have placed these "debug" strings everywhere
they need to be. We all wish that error reporting would tell us all sorts of
things, but in VB/VBA it doesn't. There may be some sort of API voodoo to
get the current call stack, but it's nothing built-in to the language.




All times are GMT +1. The time now is 11:39 PM.

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