Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" _ '~~> We will use this to store the rotated image '~~> API to get the user's temp folder path If you do then simply ask :) Option Explicit I have also commented the code so you shouldn't have any problem understanding it. You can create extra buttons for rest of the degrees. Like I mentioned that This example will rotate it 90 degrees as I am just demonstrating for 90.
I have written a sub RotatePic to which you can pass the degree. Set the Image Control's PictureSizeMode to fmPictureSizeModeStretch in the properties window.
ROTATE SPIN BUTTON EXCEL HOW TO
Below I have demonstrated on how to rotate the image 90 degrees.Įxport the image to user's temp directoryĬreate a userform and insert an image control and a command button. Having said that, there is an alternative to achieve what you want. Like I mentioned, there is no inbuilt way to rotate a picture in userform. Any changes would reference pic1-pic5 (only ever 5 pics at any time). Pictures are inserted depending on value selected in combobox. Thinking it may be an FileSystemObject but dont know enough about them yet to know how to do this.ĮDIT: Added some code by request. What I want to do is have buttons (90, 180, 270) for rotating the images located in "C:\Temp\Photos". I currently have a userform in excel with images displayed on it (saved in a temporary folder "C:\Temp\Photos")