+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    05-23-2008
    Posts
    20

    Exporting chartobjects as JPEGs

    Hi,

    I just started Excel programming last week. I did some research online and I found out that we need to use the Export method to save charts as jpgs.

    Here's the code I wrote but it's giving me an error saying

    Runtime error: '438'

    Object doesn't support this property or method


    Here's the code snippet:

    Code:
    Public Sub ExportChartsToJpegs()
        
         Worksheets("TotBklg").ChartObjects("chart 1").Export Filename:="C:\DefectQuery\FEP4\Current\TotalBacklog" & FName & ".jpg", FilterName:="JPG"
    
        
    End Sub
    Hope someone can help me. Thanks!

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,944
    It's the Chart object that has the export method rather than the chartobject

    Code:
    Public Sub ExportChartsToJpegs()
        
         Worksheets("TotBklg").ChartObjects("chart 1").Chart.Export Filename:="C:\DefectQuery\FEP4\Current\TotalBacklog" & FName & ".jpg", FilterName:="JPG"
    
        
    End Sub
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    05-23-2008
    Posts
    20
    Great! Thank you so much.

Thread Information

Users Browsing this Thread

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

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.2.0