VBA rotate picture then then set the properties after the rotation

zgivod

New Member
Joined
Dec 6, 2018
Messages
17
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

<code class="_34q3PgLsx9zIU5BiSOjFoM" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 13px; line-height: 20px; font-family: "Noto Mono", Menlo, Monaco, Consolas, monospace; vertical-align: baseline; color: rgb(34, 34, 34); background: transparent; max-width: 100%; overflow: auto;"> 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

</code>this gets the pic uploaded set the properties then rotates the pic
<code class="_34q3PgLsx9zIU5BiSOjFoM" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 13px; line-height: 20px; font-family: "Noto Mono", Menlo, Monaco, Consolas, monospace; vertical-align: baseline; color: rgb(34, 34, 34); background: transparent; max-width: 100%; overflow: auto;">
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

</code>the problem is that i need the pic rotated first (bec. its not a square) then set the properties but whereever i try putting ......
<code class="_34q3PgLsx9zIU5BiSOjFoM" style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-stretch: inherit; font-size: 13px; line-height: 20px; font-family: "Noto Mono", Menlo, Monaco, Consolas, monospace; vertical-align: baseline; color: rgb(34, 34, 34); background: transparent; max-width: 100%; overflow: auto;">
ActiveSheet.Shapes(ActiveSheet.Shapes.Count).Rotation = 90
</code>
before the properties i get ERROR WRONG NUMBER OF ARGUMENTS OR INVALID PROPERTY ASSIGNMENT or SYNTAX ERROR
 
Last edited:

Forum statistics

Threads
1,081,574
Messages
5,359,704
Members
400,545
Latest member
Damntheman30

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top