Microsoft Excel 2016 VBA Code to upload,rotate and change picture colors

I have a project to create VBA macro enabled Microsoft  Excel 2016  file  that would have a button to upload an image into excel. Than I need a way to rotate that image by 90 degrees +to make image lighter/darker with limits and convert image from colored to gray scale. Thank You for any help.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Darrell PorterEnterprise Business Process ArchitectCommented:
Try replacing your code with this

Public sh As Shape
Public strFile As String
Public rng As Range

Private Sub CommandButton1_Click()
    Const cFile As String = "Image Files(*.bmp;*gif;*.jpg;*.jpeg;*.png),"
    strFile = Application.GetOpenFilename(filefilter:=cFile, Title:=Es)
    If strFile = "False" Then
        ' Do nothing if it's false (not sure why you did it this way)
        Set rng = Range("A1:A1")
        Set rng = rng.MergeArea
        With rng
            Set sh = ActiveSheet.Shapes.AddPicture(Filename:=strFile, linktoFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=.Left, Top:=.Top, Width:=.Width, Height:=.Height)
            sh.LockAspectRatio = msoFalse
        End With
    End If
End Sub
Private Sub CommandButton2_Click()
        With rng
            ' switch height and width (because of the 90 degrees rotation)
            sh.Width = .Height
            sh.Height = .Width
            'Rotate Picture and adjust position
            With sh
                .Locked = False
                .Rotation = 90
                .IncrementLeft sh.Height / 2 - sh.Width / 2
                .IncrementTop sh.Width / 2 - sh.Height / 2
            End With
        End With
End Sub

Open in new window

You will need to fix the rotation section of the code to get the aspect ratio correct - am a bit too tired to fix that at the moment.
I moved the shape, range, and filename into public variables so they could be used by both subs.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
NickAuthor Commented:
Thank You Darrell for a quick response. The picture is rotating now ) Trying to get aspect ration correct and get image lighter and darker now.
NickAuthor Commented:
Hi Experts, I still need help with adding  code to make attached to excel picture lighter and darker. I do not even know where to start.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.