Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resizing Pictures with VBA or API

Status
Not open for further replies.

sabascal

IS-IT--Management
Joined
Aug 20, 2002
Messages
85
Location
GB
Hi all,

is there a way to resize a picture in VBA or with a free API.
Ultimate objective would be to be able to select my picture on a excel sheet, and apply my procedure to it.

Thanks,
Seb
 
Hi,

Not knowing exactly what you are trying to do, something like this might work...
Code:
    For Each sh In ActiveSheet.Shapes
        With sh
            Select Case .Name
                Case "Sheet1": .OnAction = "Macro1"
                Case "Sheet2": .OnAction = "Macro2"
            End Select
            With .ShapeRange
                .LockAspectRatio = msoTrue
                .Height = .Height * 1.5
            End With
        End With
    Next
:-)

Skip,
Skip@TheOfficeExperts.com
 
Sorry for not being specific.

What I mean by resize is also changing the resoltion. (decreasing the size of the picture as a consequence)
I'd to do the same thing as when you do a resize in Microsoft Paint.

Thanks,
Seb
 
Then you would have to find a reference to your graphics application in the VBE tools/references if you have one and from there, you're on your own!

Skip,
Skip@TheOfficeExperts.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top