Shape &combobox

  • Thread starter Thread starter Milena
  • Start date Start date
M

Milena

Hi!!
I have a trouble with the copy/paste a combobox linked on
a cell in a worksheet, usign vb6.
My code is:

Set oShape = oSheet.Shapes("ComboBox3")
oShape.Select
'''' HERE I HAVE A PROBLEM: the error is "The select
method of the shape failed"...AND I DON'T UNEDERSTAND WHY!!

Selection.Copy
Set oPaste = oSheet.Cells(lngRowCounter + 1, 4)
oPaste.Select
oSheet.PasteSpecial Format:="Microsoft Forms 2.0
ComboBox Object", Link _
:=False, DisplayAsIcon:=False

I need help!!

Thanks!
Milena
 
If oSheet is not Active, the .Select will fail.

one way:

With oSheet
.Select
.Shapes("ComboBox3").Copy
.Cells(lngRowCounter + 1, 4).Select
.PasteSpecial _
Format:="Microsoft Forms 2.0 ComboBox Object", _
Link:=False, _
DisplayAsIcon:=False
End With
 
Back
Top