ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel 2003/vbx macro errors. (https://www.excelbanter.com/excel-programming/444320-excel-2003-vbx-macro-errors.html)

Phil B[_5_]

Excel 2003/vbx macro errors.
 
I'm developing some vba macros under excel 2003 and am (naturally) getting
errors.
Compile time errors highlight the offending line, but seemingly not run time
errors.

All I'm getting is a helpful message eg 'Invalid procedure call or argument'
but no clue as to which line of code is giving this.
Isn't it possible to get the environment to highlight the offending source
line?
There must be a better way than a liberal sprinkling of print and msgbox
diagnostics.

regards
Phil B




Clif McIrvin[_3_]

Excel 2003/vbx macro errors.
 
"Phil B" <phil.remove.brady@hotmail dot co dot united kingdom wrote in
message ...
I'm developing some vba macros under excel 2003 and am (naturally)
getting errors.
Compile time errors highlight the offending line, but seemingly not
run time errors.

All I'm getting is a helpful message eg 'Invalid procedure call or
argument' but no clue as to which line of code is giving this.
Isn't it possible to get the environment to highlight the offending
source line?
There must be a better way than a liberal sprinkling of print and
msgbox diagnostics.



Hi Phil - are you using [ On Error .... ] statements in your code? For
initial debugging you might comment them all out so that VBA will give
you the option of dropping into the debugger on an error ... and then
the error line will be highlighted for you.

If that doesn't help, the message indicates that your code is calling a
sub or function and the call is failing ... perhaps you wrote the
procedure with a required parameter and your call isn't providing it.

My standard technique for tracking down " strange " errors is exactly
what you mention .. judicious (liberal ?) use of debug.print (I
sometimes use msgbox, but generally prefer the print. You should be
able to identify "milestones" in your code this way, and narrow down
your investigation area.

--
Clif McIrvin

(clare reads his mail with moe, nomail feeds the bit bucket :-)



Jim Cone[_2_]

Excel 2003/vbx macro errors.
 

Under Tools | Options | General (tab) in the VBE, change Break on unhandled errors to Break on all
errors.
--
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware
(Formats & Styles: lists/removes unused styles & number formats - in the free folder)




"Phil B" <phil.remove.brady@hotmail dot co dot united kingdom wrote in message
...
I'm developing some vba macros under excel 2003 and am (naturally) getting errors.
Compile time errors highlight the offending line, but seemingly not run time errors.

All I'm getting is a helpful message eg 'Invalid procedure call or argument' but no clue as to
which line of code is giving this.
Isn't it possible to get the environment to highlight the offending source line?
There must be a better way than a liberal sprinkling of print and msgbox diagnostics.

regards
Phil B






Phil B[_5_]

Excel 2003/vbx macro errors.
 
thanks! that's exactly what I was looking for!
Phil

"Jim Cone" wrote in message
...

Under Tools | Options | General (tab) in the VBE, change Break on
unhandled errors to Break on all errors.
--
Jim Cone
Portland, Oregon USA
http://www.mediafire.com/PrimitiveSoftware
(Formats & Styles: lists/removes unused styles & number formats - in the
free folder)




"Phil B" <phil.remove.brady@hotmail dot co dot united kingdom wrote in
message
...
I'm developing some vba macros under excel 2003 and am (naturally)
getting errors.
Compile time errors highlight the offending line, but seemingly not run
time errors.

All I'm getting is a helpful message eg 'Invalid procedure call or
argument' but no clue as to which line of code is giving this.
Isn't it possible to get the environment to highlight the offending
source line?
There must be a better way than a liberal sprinkling of print and msgbox
diagnostics.

regards
Phil B





All times are GMT +1. The time now is 01:45 PM.

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