Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Unique item to Collection
I was pretty sure I knew how collections worked, but why do I get a run time
error (457) with this macro? Doesn't the On Error Resume Next trap that error? XL2000, Win98SE. Sub test() Dim theColl As New Collection theColl.Add "me", "me" On Error Resume Next theColl.Add "me", "me" On Error GoTo 0 End Sub Thanks. -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Unique item to Collection
Dick
It works for me in XL2002 without an error. Regards,] Jim Cone San Francisco, CA "Dick Kusleika" wrote in message ... I was pretty sure I knew how collections worked, but why do I get a run time error (457) with this macro? Doesn't the On Error Resume Next trap that error? XL2000, Win98SE. Sub test() Dim theColl As New Collection theColl.Add "me", "me" On Error Resume Next theColl.Add "me", "me" On Error GoTo 0 End Sub Thanks. Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Unique item to Collection
Dick,
I don't get that error, it steps through nicely. XL2000, XP. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Dick Kusleika" wrote in message ... I was pretty sure I knew how collections worked, but why do I get a run time error (457) with this macro? Doesn't the On Error Resume Next trap that error? XL2000, Win98SE. Sub test() Dim theColl As New Collection theColl.Add "me", "me" On Error Resume Next theColl.Add "me", "me" On Error GoTo 0 End Sub Thanks. -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Unique item to Collection
Jim
Thanks for checking. I don't remember any problems with collection in 2000, but maybe there is. BTW, I tested it in XL97 and had no problem. Dick "Jim Cone" wrote in message ... Dick It works for me in XL2002 without an error. Regards,] Jim Cone San Francisco, CA "Dick Kusleika" wrote in message ... I was pretty sure I knew how collections worked, but why do I get a run time error (457) with this macro? Doesn't the On Error Resume Next trap that error? XL2000, Win98SE. Sub test() Dim theColl As New Collection theColl.Add "me", "me" On Error Resume Next theColl.Add "me", "me" On Error GoTo 0 End Sub Thanks. Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Unique item to Collection
Hi dick
No error for me in XL 2000,WinXP -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "Dick Kusleika" wrote in message ... I was pretty sure I knew how collections worked, but why do I get a run time error (457) with this macro? Doesn't the On Error Resume Next trap that error? XL2000, Win98SE. Sub test() Dim theColl As New Collection theColl.Add "me", "me" On Error Resume Next theColl.Add "me", "me" On Error GoTo 0 End Sub Thanks. -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Unique item to Collection
Thanks Bob and Ron.
I don't know what the heck's going on here. I regserver'ed, code cleaned and rebooted all to no avail. That's the extent of my troubleshooting skills, so I'll be using a workaround until I can start messing with it. Dick "Ron de Bruin" wrote in message ... Hi dick No error for me in XL 2000,WinXP -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "Dick Kusleika" wrote in message ... I was pretty sure I knew how collections worked, but why do I get a run time error (457) with this macro? Doesn't the On Error Resume Next trap that error? XL2000, Win98SE. Sub test() Dim theColl As New Collection theColl.Add "me", "me" On Error Resume Next theColl.Add "me", "me" On Error GoTo 0 End Sub Thanks. -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Unique item to Collection
Send me your test workbook if you want Dick.
I can test it again for you -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "Dick Kusleika" wrote in message ... Thanks Bob and Ron. I don't know what the heck's going on here. I regserver'ed, code cleaned and rebooted all to no avail. That's the extent of my troubleshooting skills, so I'll be using a workaround until I can start messing with it. Dick "Ron de Bruin" wrote in message ... Hi dick No error for me in XL 2000,WinXP -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "Dick Kusleika" wrote in message ... I was pretty sure I knew how collections worked, but why do I get a run time error (457) with this macro? Doesn't the On Error Resume Next trap that error? XL2000, Win98SE. Sub test() Dim theColl As New Collection theColl.Add "me", "me" On Error Resume Next theColl.Add "me", "me" On Error GoTo 0 End Sub Thanks. -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Unique item to Collection
Hi Dick,
Sounds like you have the 'Break on all Errors' option set. Check your VBE options, Error trapping is on the General tab. Try one of the other 2 options. Dick Kusleika wrote: I was pretty sure I knew how collections worked, but why do I get a run time error (457) with this macro? Doesn't the On Error Resume Next trap that error? XL2000, Win98SE. Sub test() Dim theColl As New Collection theColl.Add "me", "me" On Error Resume Next theColl.Add "me", "me" On Error GoTo 0 End Sub Thanks. -- Cheers Andy http://www.andypope.info |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Unique item to Collection
Andy
Yep, that was it. I wonder how that got changed? I choose to believe that it was a malicious virus instead of my own carelessness. Thanks. Dick "Andy Pope" wrote in message ... Hi Dick, Sounds like you have the 'Break on all Errors' option set. Check your VBE options, Error trapping is on the General tab. Try one of the other 2 options. Dick Kusleika wrote: I was pretty sure I knew how collections worked, but why do I get a run time error (457) with this macro? Doesn't the On Error Resume Next trap that error? XL2000, Win98SE. Sub test() Dim theColl As New Collection theColl.Add "me", "me" On Error Resume Next theColl.Add "me", "me" On Error GoTo 0 End Sub Thanks. -- Cheers Andy http://www.andypope.info |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
To find rate of each item from item.xls and to copy price.xls | Excel Discussion (Misc queries) | |||
unique item remover | Excel Discussion (Misc queries) | |||
Adding Unique Items to a Collection | Excel Discussion (Misc queries) | |||
Item numbers result in item description in next field in Excel | Excel Worksheet Functions | |||
Removing an Item From a Collection | Excel Programming |