+ Reply to Thread
Results 1 to 10 of 10

Macro to show image

  1. #1
    Forum Contributor
    Join Date
    01-22-2022
    Location
    UK
    MS-Off Ver
    365
    Posts
    130

    Macro to show image

    What's the best way to show high quality images using a macro. The images contain small text and are basically aids for a calculation spreadsheet.

    Have tried images in userform but the quality is not great.

    Also do the image files need to be always saved to a folder or do they get embedded in the workbook?

  2. #2
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,177

    Re: Macro to show image

    paste this code into a module
    the cells should store the PATH of the file: \\server\folder\folder2\image.jpg
    it will open any file in its native app: Jpg in your default image editor, word docs in word, pdf in acrobat or web browser


    usage: OpenNativeApp range("a1")




    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,535

    Re: Macro to show image

    "Show high quality images". So they are high quality already? If they are, they should stay reasonable good. Some type are better than other They say.
    Experiment with the different types (bmp, jpg, gif, png).

    Re: "Also do the image files need to be always saved to a folder or do they get embedded in the workbook?"
    Either way. Whatever your preference.

    Pictures.Insert references a file. Does not go with workbook.
    Shapes.AddPicture permanently inbeds picture. Stays with workbook.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Experience trumps academics every day of the week and twice on Sunday.

  4. #4
    Forum Contributor
    Join Date
    01-22-2022
    Location
    UK
    MS-Off Ver
    365
    Posts
    130

    Re: Macro to show image

    Thanks for providing code ranman256 and jolivanes, both solutions work.

    Have you come across image viewers within Excel, where you could view left or right. From a web search noted terms such as Plugins for Image, Image Assistant, etc.
    I don't think there is a native viewer within Excel, for viewing rather than inserting (such as from insert Tab, Pictures, This Device).
    Last edited by lb_33; 04-25-2024 at 08:49 PM.

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,535

    Re: Macro to show image

    I use IrfanView as a picture viewer also.
    Not a native Excel program but a very good, and free, program.

  6. #6
    Forum Contributor
    Join Date
    01-22-2022
    Location
    UK
    MS-Off Ver
    365
    Posts
    130

    Re: Macro to show image

    Thanks jolivanes, I was hoping an image viewer was available within excel so that you could see and edit workbook at the same time as viewing image.

  7. #7
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,535

    Re: Macro to show image

    I guess that request comes up on a regular basis but of course the more or less standard answer is that Excel is not a program for that kind of stuff.
    We'll live with it.

    Good luck though.

  8. #8
    Forum Contributor
    Join Date
    01-22-2022
    Location
    UK
    MS-Off Ver
    365
    Posts
    130

    Re: Macro to show image

    Hi jolivanes, the attempt in this forum is probably close to what I was looking for.
    http://www.vbaexpress.com/forum/show...-Viewer-in-VBA

    Refer to post #18.

    Was getting error messages though.

  9. #9
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,535

    Re: Macro to show image

    I still use this old one every so once in a while. It is different but you can play with it.
    I have not brought it up to today's standards.
    See attached
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    01-22-2022
    Location
    UK
    MS-Off Ver
    365
    Posts
    130

    Re: Macro to show image

    Thanks again jolivanes.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] vba to show/hide flowchart process image and text via macro button
    By lilsnoop in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-13-2022, 02:43 PM
  2. [SOLVED] Userform Image Control - Show specific region of Image
    By PrizeGotti in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-09-2021, 12:04 PM
  3. #VBA problem with image,If Use other computer image Not Show"
    By daboho in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-17-2016, 09:24 AM
  4. [SOLVED] Need a macro to show multiple images on a sheet based on the name of the image file
    By Nirmall in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-29-2015, 11:20 AM
  5. Macro to Show image based on Style Number
    By jussie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-19-2015, 03:19 AM
  6. [SOLVED] use macro to hide or show image
    By cyee in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-04-2014, 03:02 AM
  7. use macro to hide or show bitmap image
    By John Davies in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-30-2013, 03:59 AM

Tags for this Thread

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