×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Rotaing pictures in excel

Rotaing pictures in excel

Rotaing pictures in excel

(OP)
Can anyone please advise if and how pictures (such as jpg format) can be rotated in excel using VBA after they have been inserted into a workbook.

MAny thanks in advance

iken

RE: Rotaing pictures in excel

Try this:

Sub Macro1()
    ActiveSheet.Shapes("Picture").Rotation = 33#
End Sub

"Picture" is the name of your picture
33# means 33 degrees
as an example

Hope this helps

Mogens

RE: Rotaing pictures in excel

(OP)
Thanks
mgp,

however the sub you typed only applies to drawings drawn in excel (using drawing utilities.

It does not work for either jpg or bitmap images that have been imported into a worksheet.

I am unsure if what I am requiring is possible or not, but any further assistance would be greatly appreciated.

iken

RE: Rotaing pictures in excel

You can't.

You need to rotate before insertion

TTFN

RE: Rotaing pictures in excel

It works on my machine.

All I did was to record the macro while rotating the picture and then clean up the code. I tried to import a new picture and rotate this with the same code, this also worked.

I'll send you the spreadsheet if you mail me at mgp@mxl.dk

I know that some objects cannot be rotated (e.g. a text box) and I have also wondered sometimes objects are no longer rotatable even though I recalled they used to be. Never found out why though.

Could it be the properties of the picture that causes the rotation angle to freeze/lock?


regards
Mogens

RE: Rotaing pictures in excel

I've tried your code on various imported objects and get a permission error (runtime error 70) .  

The code seems to work only on autoshapes created in Excel.

My email is arbiter007@hotmail.com

TTFN

RE: Rotaing pictures in excel

The new code does exactly the same,  must be something unique to Excel2002.

Thanks for the email..

TTFN

RE: Rotaing pictures in excel

Bad luck then

So the answer to iken is that it works in Excel 2002 but apparently not in previous versions.

Regards
Mogens

RE: Rotaing pictures in excel

(OP)
Many thanks mgp & IRstuff, looks like it may be time to upgrade my Excel.

iken

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources