How to Export images From excel as given Cells name?

Rexana

New Member
Joined
Jul 13, 2020
Messages
6
Office Version
  1. 2016
Platform
  1. Windows
  2. Mobile
I have an Excel Sheet with 15000 Rows including Product Name in Column "A",
Including Product Images in Column "B".
Now, How can I export All of these Pictures in a Folder as Column A product name.
It will save My Day.
 
I use a slightly different method to export pictures. Instead of
VBA Code:
img.CopyPicture xlScreen, xlPicture
I just use
VBA Code:
 img.copy
. Not sure if that would make a difference. You can see my code here, post #13.
I will try this now.
 
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Merely changing that line probably won't work. I didn't download your workbook because the site asked me to log in and I don't want to create accounts here and there. So, I can't really test on your workbook. Consider using Dropbox. It doesn't require people to log in to download.
 
Upvote 0
I just tested DanteAmor's code. It works for me. I have four pictures in one sheet, 3 of them on Col B, 1 not. After running his code, I got three pictures saved.

Did you modify his code in any way?
 
Upvote 0
Hi,

I am trying to do exactly what OP asked for and I get same white blank (1KB pictures) in my folder. I tried Yky's suggestions in here. Also Yky's code (on the other thread) is working to export the pictures, but not to name them according to column A.

Any suggestions?

( Column A : name , Column B: Pic)

Thanks
 
Upvote 0
I might have found out what went wrong in DanteAmor's code. Just deleting the object isn't enough. You need to set it to nothing also. Try adding one line to DanteAmor's code.

VBA Code:
          .Delete
          Set tempChart = Nothing '<= add this line of code
 
Last edited:
Upvote 0
If you are still getting a blank/white image, try activating the chart object before you copy/paste. So, for example, with Dante's code...

VBA Code:
        With tempChart
          .Activate
          .Border.LineStyle = xlLineStyleNone
          .Chart.Paste
          .Chart.Export sPath & sName & ".gif"
          .Delete
        End With

Hope this helps!
 
Upvote 0
If you are still getting a blank/white image, try activating the chart object before you copy/paste. So, for example, with Dante's code...

VBA Code:
          .Activate

Amazing, that little line did the trick!

Thanks both for your time!
 
Upvote 0
Looking at this now.... wondering if the images have to be locked to the cell? It's in the properties tab there's an option to scale and move with cell
 
Upvote 0

Forum statistics

Threads
1,224,829
Messages
6,181,218
Members
453,024
Latest member
Wingit77

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top