How to export all images at once from Excel?
Supposing you have a lot of pictures in your workbook and want to save them to a specific folder at a time, usually, you can copy and paste the pictures one by one manually for saving, but it is time-consuming to copy and paste them repeatedly like this. Here, I will introduce you some tips to solve this job.
Export all images at once from Excel with Save As function
With the Excel built-in Save As function, you can save a workbook as Web Page to save all pictures including charts, shapes and other objects in a folder. Please do as follows.
1. Open the workbook with the pictures you want to save. Click File > Save As > Browse.
2. In the Save As dialog box, you need to:
3. In the popping up Microsoft Excel dialog box, click the Yes button.
4. Open the folder where the exported files are saved and you can see a folder and a HTML format file listed inside. All pictures in the workbook including charts, shapes or objects are saved in this folder.
5. You can keep the pictures you need in the folder and delete others you don’t need
Easily export All Images At Once From Excel With an amazing tool
The above method will extract all objects from the workbook, maybe, some of them you don’t need. If you have Kutools for Excel installed in Excel, its Export Graphics feature may help you save only the pictures you need.
After installing Kutools for Excel, please do as follows:
1. Click Kutools Plus > Import & Export > Export Graphics:
2. In the Export Graphics dialog box, please configure as follows:
3. Then a dialog box pops up to tell you how many pictures have been successfully exported, click the OK button.
Now you can go to the destination folder and check the exported images.
Please click Export Graphics to know more about this feature.
Before applying Kutools for Excel, please download and install it firstly.
Export images and rename them with the adjacent cell values
As shown in the screenshot below, there are two columns, one contains a list of fruit names and the other contains the corresponding pictures of the fruits. To export these images and automatically name them with the corresponding fruit names, you can try the VBA code in this section.
1. In the worksheet where you want to export the pictures, press the Alt + F11 keys to open the Microsoft Visual Basic for Applications window.
2. In the Microsoft Visual Basic for Applications window, click Insert > Module. And then copy the following VBA into the Module window.
VBA code: Export pictures in a column and name them automatically
Sub ExportImages_ExtendOffice()
'Updated by Extendoffice 20220308
Dim xStrPath As String
Dim xStrImgName As String
Dim xImg As Shape
Dim xObjChar As ChartObject
Dim xFD As FileDialog
Set xFD = Application.FileDialog(msoFileDialogFolderPicker)
xFD.Title = "Please select a folder to save the pictures" & " - ExtendOffice"
If xFD.Show = -1 Then
xStrPath = xFD.SelectedItems.Item(1) & "\"
Else
Exit Sub
End If
On Error Resume Next
For Each xImg In ActiveSheet.Shapes
If xImg.TopLeftCell.Column = 2 Then
xStrImgName = xImg.TopLeftCell.Offset(0, -1).Value
If xStrImgName <> "" Then
xImg.Select
Selection.Copy
Set xObjChar = ActiveSheet.ChartObjects.Add(0, 0, xImg.Width, xImg.Height)
With xObjChar
.Border.LineStyle = xlLineStyleNone
.Activate
ActiveChart.Paste
.Chart.Export xStrPath & xStrImgName & ".png"
.Delete
End With
End If
End If
Next
End Sub
Notes:
3. Press the F5 key to run the code. In the opening window, select a folder to save the pictures and then click OK.
Then all pictures in a specified column are exported and automatically named with the adjacent cell values as you specified.
Related article:
How to export charts to graphics in Excel?
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!