Shape &combobox

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
 
J

J.E. McGimpsey

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top