Question: I'm trying to query MSMQ with Powershell, and then read (in my case) XML out of the BodyStream. Stripping out the crap before the XML is *slow*... like 200-500ms per record.

Pulling the XML out seems okay fast (below), but that replace takes forever.

```
$msmq = Get-MsmqQueue -Name "myqueuelovesme"
$var = Receive-MsmqQueue -input $msmq -Peek -Count 500 -Timeout 5000 -RetrieveBody | foreach {
$sr = $_.BodyStream.ToArray()
$pr = $enc.GetString($sr)
[xml]$clean= $pr -creplace ".*:Message:"
select-xml -xml $clean -XPath "/MyXML/Defin" | foreach {$_.node}
}
$var

```

The contents of bodystream look like this:

```
F:01.02.03:1234567890:Message:<MyXML><Defin xmlns:dsi="http:// [...]

```

The XML always starts after that 4th semicolon, so I don't think I can split/join (as the number of semicolons in the XML can change). I see that creplace is faster than replace, but neither is great.

Any suggestions? (And heck, is the rest of the code okay?)

Answer: 
Looks like you'll have to populate your combobox item-by-item.
Given that it is a dynamic list I suggest that you put the code in the Userform's Activate event.
Note that this event is found (and the code should be placed) in the Userform's code module NOT in a general code module.

```
Private Sub UserForm_Activate()
Dim nme As Range
Dim ws As Worksheet

Set ws = Sheets("Members List")
    For Each nme In ws.Range("nameList")
        Me.username_Insert.AddItem nme.Value
    Next nme

End Sub

```
Adding items line-by-line *works*, but it can be done more straightforwardly (and elegantly) by simply populating the LIST property of the Combobox with all the values in one line of code as follows :

```
Private Sub Userform_Activate()
    username_Insert.List = Sheets("Members List").Range("nameList").value
End sub

```

You were very close in your original attempts, you just needed to add .value to the 

=Range("nameList") 

line. :-)