I am trying to create a dictionary in a function that is used in a sub, but I get the error
"User defined type not defined".
I don't know if it's very obvious but I can't see what is the problem.
I've simplified the code to make a simple code:
Public Function create_dic(ByVal var As String) As Dictionary
my_dic.CompareMode = vbTextCompare
If var = "test" Then
my_dic.Add Key:="var 1", Item:=1
Else
my_dic.Add Key:="var 2", Item:=2
End If
Set create_dic = my_dic
End Function
Sub prueba()
Set respuesta = create_dic("test")
End Sub