Results 1 to 1 of 1

Thread: Saving Embedded Picture From Excel Workbook Sheet To Folder Hard Drive

  1. #1
    Member littleiitin's Avatar
    Join Date
    Aug 2011
    Posts
    90
    Rep Power
    13

    Saving Embedded Picture From Excel Workbook Sheet To Folder Hard Drive

    Code:
    Sub ExportImageinExceltoADrive(strsheetName As String, strPicName As String, strPathtoSavewithImageName As String)
        
        Dim chtTempChart    As ChartObject
        
        With ThisWorkbook.Worksheets(strsheetName)
             Set chtTempChart = .ChartObjects.Add(500, 500, 500, 350)
            With chtTempChart.Chart
                .ChartType = xlLine
                .Location Where:=xlLocationAsObject, Name:=strsheetName
                .HasLegend = False
            End With
            .Shapes(strPicName).Copy
            chtTempChart.Activate
            chtTempChart.Chart.Paste
            chtTempChart.Chart.Export Filename:=strPathtoSavewithImageName, FilterName:="jpeg"
            chtTempChart.Delete
        End With
    End Sub
    Below is Example How to Use:

    Code:
    Sub ExportExample()
     
     Dim strPath     As String
     Dim strSheet    As String
     Dim strPicName  As String
     
    '========Sheet Name where Image is==========================================
     strSheet = "3333"
    '===========================================================================
    
    '=======Image Name==========================================================
     strPicName = "Picture 10"
    '===========================================================================
    
    '=======Path where you want to Save this Image with Image Name==============
    '==============You can write any name in Place of "Background-16"===========
    
     strPath = "K:\ExcelFox\Background-16.jpg"
    '===========================================================================
    
     Call ExportImageinExceltoADrive(strSheet, strPicName, strPath)
    End Sub
    Last edited by littleiitin; 10-31-2011 at 02:57 PM.

Similar Threads

  1. Replies: 6
    Last Post: 09-24-2013, 04:13 PM
  2. Split Workbook In To Sheets, Export To Folder and Move File
    By doug@powerstroke.us in forum Excel Help
    Replies: 2
    Last Post: 05-22-2013, 06:45 PM
  3. Replies: 7
    Last Post: 05-08-2013, 07:12 PM
  4. Replies: 1
    Last Post: 02-14-2013, 12:09 PM
  5. Replies: 0
    Last Post: 04-03-2011, 07:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •