I am writing in vba for MSExcel. I have set up procedures to read an xml config file and to store the default values into 3 different collections.
Dim ExportHdrs As Collection
Dim ExpectHdrs As Collection
Dim DeleteHdrs As Collection
I need to know if there is a way to reference a collection object through the use of a string or variable value. I would like to be able to refer to each collection simply by concatenating the action type with the string "Hdrs" (see below). I am having serious problems trying to find information on how to do this.
For instance; if the variable sType holds the first part of the collection name and the string "Hdrs" is the 2nd half...
to get the value of a control on a form, you use:
x = Me.Controls(sType & "Hdrs").value
a recordset:
x = rs.Fields(sType & "Hdrs")
Can the same be done for a collection? How?
x = ??????.??????(sType & "Hdrs")
Thanks in advance!
Dim ExportHdrs As Collection
Dim ExpectHdrs As Collection
Dim DeleteHdrs As Collection
I need to know if there is a way to reference a collection object through the use of a string or variable value. I would like to be able to refer to each collection simply by concatenating the action type with the string "Hdrs" (see below). I am having serious problems trying to find information on how to do this.
For instance; if the variable sType holds the first part of the collection name and the string "Hdrs" is the 2nd half...
to get the value of a control on a form, you use:
x = Me.Controls(sType & "Hdrs").value
a recordset:
x = rs.Fields(sType & "Hdrs")
Can the same be done for a collection? How?
x = ??????.??????(sType & "Hdrs")
Thanks in advance!