G
Guest
Hi,
I am trying to move a shape that is selected to the left. Have the below code:
Sub Test()
Dim oSheet as workhseet
Dim oShape as Shape
Dim oObj as Object ' I don't know if the shape or something else is selected, so I get the object selected.
set oSheet = Application.ActiveSheet
oObj = Application.Selection
if TypetName(oObj) = "Picture" then
' Shape selected
set oShape = oObj ' Try to convert to oShape to access its properties. I get an error type mismatch here
oShape.left = oShape.left - 60
end if
End Sub
Thank you,
Carlos Lozano
I am trying to move a shape that is selected to the left. Have the below code:
Sub Test()
Dim oSheet as workhseet
Dim oShape as Shape
Dim oObj as Object ' I don't know if the shape or something else is selected, so I get the object selected.
set oSheet = Application.ActiveSheet
oObj = Application.Selection
if TypetName(oObj) = "Picture" then
' Shape selected
set oShape = oObj ' Try to convert to oShape to access its properties. I get an error type mismatch here
oShape.left = oShape.left - 60
end if
End Sub
Thank you,
Carlos Lozano