pasting to a location

W

Web_Builder

Hi I know this is basically a repeat of a past post of mine but I never got
it answered so I am trying again.
I need to copy from a hidden worksheet & paste to a hidden diaog box,
putting the picture in a specific location in the dialog box. My code isn't
working, here is what I have...

This is my current code. It doesn't work & hangs up where I try to place the
image.

If Sheets("Order Info").Cells(4, 6).Value = "2270" Then
Sheets("Doors").Shapes("2270").Copy
DialogSheets("Door").Paste

< I get an error 438 here>
Selection.ShapeRange.IncrementLeft 144.75
Selection.ShapeRange.IncrementTop 34.5
DialogSheets("Door").Show


Can anyone help me do this?
Thanks.
 
S

sebastienm

Hi,
-Do you get the error on the line
DialogSheets("Door").Paste
or on thne line
Selection.ShapeRange.IncrementLeft 144.75
?
-What is the active sheet when these lines of code are executed.
-What is the description of the error?

Regards,
Sebastien
 
W

Web_Builder

I get the error on the
Selection.ShapeRange.IncrementLeft 144.75
line.

the active sheet is worksheet not before mentioned, the only one visable to
the viewer.

The error is as follows:
Run-time error '438':
Object doesn't support this property or method.
 
S

sebastienm

ok.
-One thing: to Selection, the sheet needs to be activated. In any case, it
is better not to use it when possible and use code that does not depend on
the activation of the sheet, something like (also, i removed the use of
SHapeRange):
Dim Counter as Long
If Sheets("Order Info").Cells(4, 6).Value = "2270" Then
Sheets("Doors").Shapes("2270").Copy
DialogSheets("Door").Paste
i= DialogSheets("Door").Shapes.Count '<-- shape is last one added
...
DialogSheets("Door").Shapes(i).IncrementLeft 144.75
DialogSheets("Door").Shapes(i).IncrementTop 34.5
DialogSheets("Door").Show

Does this work for you?
Regards,
Sebastien
 

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