ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   pasting to a location (https://www.excelbanter.com/excel-programming/309001-pasting-location.html)

Web_Builder[_2_]

pasting to a location
 
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.

sebastienm

pasting to a location
 
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
"Web_Builder" wrote:

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.


Web_Builder[_2_]

pasting to a location
 
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.


"sebastienm" wrote:

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
"Web_Builder" wrote:

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.


sebastienm

pasting to a location
 
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

"Web_Builder" wrote:

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.


"sebastienm" wrote:

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
"Web_Builder" wrote:

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.



All times are GMT +1. The time now is 09:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com