Results 1 to 2 of 2

Thread: VBA rotate picture then then set the properties after the rotation
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Dec 2018
    Posts
    17
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default VBA rotate picture then then set the properties after the rotation

    im trying to get a picture uploaded then rotated then set properties.
    this gets my pic uploaded to the properties i want, but not rotated

    Sub tyh()
    ActiveSheet.Shapes.AddPicture _
    Filename:="C:\Users\dovi.dovi-PC\Desktop\ads bh\IMG-7042.jpg", _
    LinkToFile:=msoFalse, savewithdocument:=msoCTrue, _
    Left:=1200, Top:=604, Width:=350, Height:=604
    End Sub

    this gets the pic uploaded set the properties then rotates the pic

    Sub tyh()
    ActiveSheet.Shapes.AddPicture _
    Filename:="C:\Users\dovi.dovi-PC\Desktop\ads bh\IMG-7042.jpg", _
    LinkToFile:=msoFalse, savewithdocument:=msoCTrue, _
    Left:=1200, Top:=604, Width:=350, Height:=604
    ActiveSheet.Shapes(ActiveSheet.Shapes.Count).Rotation = 90
    End Sub

    the problem is that i need the pic rotated first (bec. its not a square) then set the properties but whereever i try putting ......

    ActiveSheet.Shapes(ActiveSheet.Shapes.Count).Rotation = 90

    before the properties i get ERROR WRONG NUMBER OF ARGUMENTS OR INVALID PROPERTY ASSIGNMENT or SYNTAX ERROR
    Last edited by zgivod; Jul 18th, 2019 at 09:26 PM.

  2. #2
    Moderator mole999's Avatar
    Join Date
    Oct 2004
    Location
    UK
    Posts
    9,855
    Post Thanks / Like
    Mentioned
    16 Post(s)
    Tagged
    2 Thread(s)

    Default Re: VBA rotate picture then then set the properties after the rotation

    Width:=350, Height:=604 how about Width:=604, Height:=350
    • Yes I know there are better ways to do it. I just wish I knew them. - 97, 2003, 2007, 2010, 2013, 2016 & 2019
    • I wear my ignorance openly, excel is not my chosen career, its a means to an ends
    • Posting Guidelines Want to post well laid out questions and answers Translate Excel Versions
      Code:
      [CODE ]Put Your Code[/ CODE]
    • Settings > General Settings (on the left) scroll to the bottom, > Miscellaneous Options > Use ENHANCED
    • X-Posting Guidelines Rule 13 > CHART STUFF

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •