Results 1 to 2 of 2

Save images from excel file VBA

Threaded View

  1. #1
    Registered User
    Join Date
    02-07-2016
    Location
    Canada
    MS-Off Ver
    13
    Posts
    65

    Lightbulb Save images from excel file VBA

    Hi experts,

    I have an excel file with images in column A and text to become image names in column B.

    This code allows me to save all images from excel in .png format to a selected folder which is great.

    Sub SaveImages()
    
        'the location to save all the images
        Const destFolder$ = "C:\users\...\desktop\"
    
        Dim ws As Worksheet
        Set ws = ThisWorkbook.Worksheets("sheet1")
    
        Dim ppt As Object, ps As Variant, slide As Variant
    
        Set ppt = CreateObject("PowerPoint.application")
        Set ps = ppt.presentations.Add
        Set slide = ps.slides.Add(1, 1)
    
        Dim shp As Shape, shpName$
        For Each shp In ws.Shapes
            shpName = destFolder & shp.TopLeftCell.Offset(1, 1) & ".png"
            shp.Copy
            With slide
                .Shapes.Paste
                .Shapes(.Shapes.Count).Export shpName, 2
                .Shapes(.Shapes.Count).Delete
            End With
        Next shp
    
        With ps
            .Saved = True
            .Close
        End With
        ppt.Quit
        Set ppt = Nothing
    
    End Sub
    The issue I have is after image gets saved, it is very small. Is there a way I can save images in smaller power point slides so I wont have so much white space around it? (Image with this issue attached). Thanks!
    Attached Images Attached Images

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Save Images Using File Names From Column
    By R12345 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-14-2016, 03:07 AM
  2. [SOLVED] Need to loop a macro to save images to file - but save to user defined directory.
    By superfurry in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-19-2015, 07:49 AM
  3. Excel VBA to save PPT shapes as PNG images
    By Robert Goddard in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-30-2014, 04:39 AM
  4. How to save Linked images on excel as embedded images.
    By jonelamora in forum Excel General
    Replies: 0
    Last Post: 04-18-2013, 10:29 PM
  5. Excel cannot save file with imported images?
    By eDIN in forum Excel General
    Replies: 2
    Last Post: 09-07-2012, 03:26 PM
  6. [SOLVED] Download/Save webpage images to file using VBA
    By capnhud in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-08-2012, 11:43 AM
  7. Save a file with images in it. Not links!
    By DNAcombo in forum Excel General
    Replies: 0
    Last Post: 05-31-2011, 10:07 AM

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