+ Reply to Thread
Results 1 to 2 of 2

VB method to Reset picture size

  1. #1
    Registered User
    Join Date
    08-02-2007
    Posts
    3

    VB method to Reset picture size

    I've set up a VB function which allows the user to select any picture file from their PC/network and insert it into the excel file, using the AddPicture method (intended to be their company logo). However, this method obliges you to specify the inserted picture's width and height, which inevitably means its original aspect ratio is lost.

    Is it possibe to either tell the AddPicture method to keep the image at its original size and/or aspect ratio, or can the image be reset (via VB) to it's original size after inserting?

    I've tried recording a macro which follows the Format Picture/Size/Reset method, which does reset the picture's original size, but the recording leaves specific values in the VB text string, not something like 'Reset' or 'Original'.

    Any ideas?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello matt.will,

    Perhaps this this macro will help. It uses a Control Toolbox Image control to display bmp, gif, or jpg files on a worksheet. It automatically resizes it self to the picture's size. It prompts the user to select a file using the Open Dialog.
    Please Login or Register  to view this content.
    Assigning a Shortcut key
    1) With the workbook open, press ALT+F8 to display the macros dialog.
    2) Select "AddLogo" from the list
    3) Click Options and following the instructions.

    Sincerely,
    Leith Ross

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1