View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Stan Scott Stan Scott is offline
external usenet poster
 
Posts: 34
Default I know selected picture is a shape but typename says is picture

Carlos,

Did you copy this routine exactly? If so, you have a typo he
"TypetName"

Stan Scott
New York City

"Carlos Lozano" wrote in message
...
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