Consulting

Results 1 to 5 of 5

Thread: Export all the sheets in excel to images individually files

  1. #1

    Export all the sheets in excel to images individually files

    Hello excel experts,I am new to this vba coding ....
    I am looking for code that which can able to export all the sheets in excel to images individually files.
    I want to export each and every sheet in excel worbook to indiviudal images in .png or .jpg format at best quality.
    sheet 1 to be saved as image1.jpg
    sheet 2 to be saved as image2.jpg
    in this way.....

    thank you in advance.

  2. #2
    Hello
    What if the sheet has more than one page?

  3. #3

  4. #4
    I want what ever images or shapes present in sheet1 ,to be exported as one single image file.
    in that way ,other sheets too.
    like screen shots of every sheet in that workbook.
    sheet1 as one single image and sheet2 as other single image.
    In that way in one click all the sheets to be exported as images individually to a folder.

  5. #5
    Hello
    Create a folder named "TestFolder" in the same path of your workbook and try this code
    Sub Test()
        Dim ws          As Worksheet
        Dim rng         As Range
        Dim fname       As String
        Dim objPic      As Shape
        Dim objChart    As Chart
    
    
        Application.DisplayAlerts = False
            For Each ws In ThisWorkbook.Worksheets
                Set rng = ws.UsedRange
                fname = ws.Name
                rng.CopyPicture xlScreen, xlPicture
                Sheets.Add , Sheets(Sheets.Count)
        
                With Sheets(Sheets.Count)
                    .Shapes.AddChart
                    .Activate
                    .Shapes.Item(1).Select
                    Set objChart = ActiveChart
                    .Shapes.Item(1).Width = rng.Width
                    .Shapes.Item(1).Height = rng.Height
                    objChart.Paste
                    objChart.Export (ThisWorkbook.Path & "\TestFolder\" & fname & ".jpg")
                    .Delete
                End With
            Next ws
        Application.DisplayAlerts = True
    End Sub

Posting Permissions

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