Como saber si un combobox existe
Publicado por Ximo (2 intervenciones) el 21/01/2009 15:22:40
Como bien dice el titulo, queria ver como puedo saber si un combobox existe y dependiendo de si esxiste o no, crearlo o cambiarle el contenido.
Algo asi
If Combobox existe then
borrar contenido y poner nuevo contenido
else
crear combobox con ese nombre
end if
tambien tengo dudas con como crear el combobox, lo estoy haciendo de la siguiente manera:
Dim OleObj As OLEObject
Dim UCLpar As String
Set OleObj = ActiveSheet.OLEObjects.Add(ClassType:="Forms.ComboBox.1", _
Link:=False, _
DisplayAsIcon:=False, _
Left:=53, _
Top:=44.5, _
Width:=115, _
Height:=15)
OleObj.Name = "UCLpar"
Se puede hacer de otra manera o esta es la idonea.
Espero que me podais hechar una mano.
Algo asi
If Combobox existe then
borrar contenido y poner nuevo contenido
else
crear combobox con ese nombre
end if
tambien tengo dudas con como crear el combobox, lo estoy haciendo de la siguiente manera:
Dim OleObj As OLEObject
Dim UCLpar As String
Set OleObj = ActiveSheet.OLEObjects.Add(ClassType:="Forms.ComboBox.1", _
Link:=False, _
DisplayAsIcon:=False, _
Left:=53, _
Top:=44.5, _
Width:=115, _
Height:=15)
OleObj.Name = "UCLpar"
Se puede hacer de otra manera o esta es la idonea.
Espero que me podais hechar una mano.
Valora esta pregunta


0