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:

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Width:=350, Height:=604 how about Width:=604, Height:=350
 
Upvote 0

Forum statistics

Threads
1,213,510
Messages
6,114,040
Members
448,543
Latest member
MartinLarkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top