Results 1 to 2 of 2

How to export the images and save them as a chart title name

Threaded View

  1. #1
    Registered User
    Join Date
    07-13-2018
    Location
    Germany
    MS-Off Ver
    10
    Posts
    5

    Smile How to export the images and save them as a chart title name

    Could someone please help me in the code which would export the images and save them as a chart title name IT is exporting as a GIF but not PNG

    I would be grateful if someone would please modify my code :

    Sub export()
    
    Dim ws As Excel.Worksheet
    Dim SaveToDirectory As String
    Dim objChrt As ChartObject
    Dim myChart As Chart
    
    SaveToDirectory = ActiveWorkbook.Path & "\"
    
    For Each ws In ActiveWorkbook.Worksheets
    
    ws.Activate
    
    worksheetName = ws.Name
    If worksheetName = "EUROPE + ENG" Or worksheetName = "EUROPE" Or worksheetName = "NEW NORTH" Then
    
    For Each objChrt In ws.ChartObjects
    
    objChrt.Activate
    Set myChart = objChrt.Chart
    
    
    myFileName = SaveToDirectory & ws.Name & "_" & objChrt.Name & ".png"
    
    
    On Error Resume Next
    Kill SaveToDirectory & ws.Name & Name & ".png"
    On Error GoTo 0
    ActiveWindow.Zoom = 275
    myChart.export Filename:=myFileName, FilterName:="PNG"
    ActiveWindow.Zoom = 100
    
    Next
    
    End If
    
    Next
    
    MsgBox "Success !! All charts have been exported"
    End Sub
    Last edited by AliGW; 07-16-2018 at 04:51 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 32
    Last Post: 07-17-2018, 03:08 AM
  2. Replies: 2
    Last Post: 07-16-2018, 04:52 AM
  3. Replies: 1
    Last Post: 07-16-2018, 03:01 AM
  4. [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
  5. Replies: 1
    Last Post: 06-17-2014, 12:15 PM
  6. 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
  7. Save Chart As Image + Auto Title Text
    By Philb1 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 09-14-2011, 07:45 PM

Tags for this Thread

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