+ Reply to Thread
Results 1 to 4 of 4

VBA Export Image with wrong column name

  1. #1
    Registered User
    Join Date
    10-30-2022
    Location
    London
    MS-Off Ver
    2019
    Posts
    2

    Exclamation VBA Export Image with wrong column name

    Gencod.PNG

    Gencod.PNG

    So I have 2 problems with my VBA :

    1 : I need to export the each image of the A column with the name of the B column, but the problem is that the code will export the B2 name with the A3 images and so on.

    So at the end the names will be like :
    Image - Name/Reference
    A3 - B2
    A4 - B3
    A5 - B4...

    Second; The code will not save the images that are repeated.
    Sometimes I have 2 references with a repeated image so it will save the first reference with that image but not the second.

    Please Login or Register  to view this content.
    Thanks for your help!

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: VBA Export Image with wrong column name


    First start with removing On Error Resume Next in order to see where your logic fails ...

  3. #3
    Registered User
    Join Date
    10-30-2022
    Location
    London
    MS-Off Ver
    2019
    Posts
    2

    Re: VBA Export Image with wrong column name

    Thanks for the tip Marc!

    Actually it keeps going like nothing,

    I've changed this line from (B1,1) the code to :

    xStrImgName = xImg.TopLeftCell.Offset(1, 1).Value

    Now the problem is that it wont save all of the pictures and I'm not sure why.

    I have 48 references but will only save 43. :/

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: VBA Export Image with wrong column name

    You need to make sure the image are within the bounds of the cell.
    The topleft reference is determined by whatever cell the top left of the image is in. In your image the top of the images appear to over lap into the cells above.
    Cheers
    Andy
    www.andypope.info

+ 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 Export As Image
    By Undo in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-28-2022, 12:29 PM
  2. how to export image to jpg?
    By [kinder] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-24-2018, 07:16 PM
  3. VBA help- Macro to export png image.
    By remjac in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-16-2014, 08:09 AM
  4. Export Image Issues
    By ELC774 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-13-2014, 05:29 PM
  5. Export an image as a png file
    By bibleguy125 in forum Excel General
    Replies: 2
    Last Post: 02-27-2012, 12:37 PM
  6. Export Image to folder as .gif
    By cman_c in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-04-2009, 05:07 AM
  7. Export Worksheet to Image
    By RickyC in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-22-2009, 07:46 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