When I try to change the value of items in a collection, I get the runtime error '424' Object Required.
Windows 7 Home Premium
Microsoft Office Professional 2010
Excel version: 14.0.7116.5000 (32-bit)
Here's the test code (not sure how to make it appear like code)
Public Sub test()
Dim txtdata As New Collection
txtdata.Add "text 1"
txtdata.Add "text 2"
txtdata.Add "text 3"
txtdata(3) = txtdata(1) & txtdata(2)
End Sub
When I run this sample code, I get the runtime error '424' Object Required on the line reassigning txtdata(3). When I look at the collection in the watch window, it shows that each member of the collection is a Variant/String type.
I have tried using "Set txtdata(3) = txtdata(1) & txtdata(2)", and get the same error.
Any thoughts are greatly appreciated.
Thanks
Bookmarks