error trying to update mtext.textstring

#1
I'm getting an error when i try to update the textstring property of a mtext entity. The problem consists of the fact that the program closes it unexpectedly

Here's the code

With text entity there's no problem.

Anyone knows what's the problem?

dim prefijo as string
dim ttext as intellicad.text
dim tmtext as intellicad.mtext
dim ssset as intellicad.selectionset

set ssset=intellicad.activedocument.selectionsets.add("prueba")
ssset.SelectOnScreen
ssset.Highlight True

prefijo = "prefijo "

For a = 0 To ssset.count - 1

If UCase$(ssset.Item(a).EntityName) = "TEXT" Then
Set ttext = ssset.Item(a)
ttext.TextString = prefijo+ ttext.TextString
ttext.Update
Else
If UCase$(ssset.Item(a).EntityName) = "MTEXT" Then

Set TMTEXT = ssset.Item(a)

TMTEXT.TextString = prefijo+ TMTEXT.TextString 'here occurs the error

TMTEXT.Update

Else
msgbox "Elemento seleccionado deber ser TEXT o MTEXT"
End If
End If
Next
ssset.Highlight False
ssset.Delete
cron