Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Feb 2001
    Location
    Springdale, Arkansas
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm now using Excel 2007 and can't find how to export a chart to an image file like I could in older versions.

    I used to be able to use the code below to do it but it doesn't work in 2007. Any ideas?

    Worksheets(ActiveSheet.Name).ChartObjects(1) _
    .Chart.Export _
    Filename:="c:\current_sales.gif", FilterName:="GIF"

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts
    I can't comment on XL2007 since I don't use it, but FYI:

    Worksheets(ActiveSheet.Name).

    can be simplified to just:
    ActiveSheet.

    Steve

  3. #3
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts
    Your code works fine for me in 2007. Are you getting an error of some sort?
    Regards,
    Rory

    Microsoft MVP - Excel

  4. #4
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts
    It works for me as well.
    However, IF you are using Windows Vista OR Windows 7, you will find that Root of C:\ is by default a protected Path.

    Have you tried changing the Path to somewhere else such as My Documents?
    Andrew

  5. #5
    Star Lounger
    Join Date
    Feb 2001
    Location
    Springdale, Arkansas
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I found the answer. I was trying to save the chart from a chart sheet.

    THANKS much for your checking!

Posting Permissions

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