Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Error Handling

I'm relatively new to Excel programming (but not programming in general) -
so I have written some macros and part of the error handling - I wanted to
display an error message - including the macro that had the problem. I was
expecting to use Err.Source - but that returns Microsoft Excel. Any way to
get the source macro function name (short of hard coding a string)?

BBB


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default Error Handling

"Billy Boone" wrote in message
news:dCaxe.107311$_o.44354@attbi_s71...
I'm relatively new to Excel programming (but not programming in general) -
so I have written some macros and part of the error handling - I wanted to
display an error message - including the macro that had the problem. I
was
expecting to use Err.Source - but that returns Microsoft Excel. Any way
to
get the source macro function name (short of hard coding a string)?


Hi Billy,

Unfortunately, hard-coding the macro name in a string is the only way to
know where the error occurred. VBA does support line numbering, and there
are utilities out there that will line number your code so you can retrieve
the number of the line of code that caused the error, but I've personally
found that line numbering is a lot more trouble than it's worth.

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Handling #NUM! error Michel Khennafi Excel Worksheet Functions 1 February 26th 07 08:49 PM
Error handling with a handling routine ben Excel Programming 0 March 15th 05 03:01 PM
Error handling Gareth Excel Programming 1 July 11th 04 07:34 PM
Error Handling bw Excel Programming 3 June 20th 04 06:43 PM
Error handling John Pierce Excel Programming 3 October 3rd 03 12:17 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"