Welcome to the Excel Forum

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 06-24-2009, 04:36 PM
rajab rajab is offline
Registered User
 
Join Date: 24 Jun 2009
Location: Palo Alto, CA
MS Office Version:Excel Mac 2008, Excel 2007
Posts: 3
rajab is becoming part of the community
Batch generation of jpgs from charts in Mac Office 2008

Please Register to Remove these Ads

I have a spreadsheet with monthly data for a variety of products. All the data is contained on one page and each product has a chart on its own tab. I'd like to output the charts to jpegs for presentation on the web, with the names of the jpegs matching the names of the tabs [e.g. 3 chart tabs = 3 jpgs]. I plan to run this on a weekly or monthly basis. Is this possible to do in a batch process in Mac Office 2008 or will I need to use a VBA-capable windows version of Excel?

I have attached an xls with 3 sample products, but envision using this for up to 90 products.

Thank you for any suggestions.
Attached Files
File Type: xls price_by_sku.xls (38.0 KB, 2 views)
Reply With Quote
  #2  
Old 06-25-2009, 06:56 AM
Andy Pope's Avatar
Andy Pope Andy Pope is offline
Forum Guru
 
Join Date: 10 May 2004
Location: Essex, UK
MS Office Version:2003 & 2007 sp2
Posts: 7,223
Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding
Re: Batch generation of jpgs from charts in Mac Office 2008

I know VBA was removed but does the mac not contain any scripting capability now?

If not then I guess you answered your own question with,
"will I need to use a VBA-capable windows version of Excel"
__________________
Cheers
Andy
www.andypope.info
Reply With Quote
  #3  
Old 06-25-2009, 10:51 AM
rajab rajab is offline
Registered User
 
Join Date: 24 Jun 2009
Location: Palo Alto, CA
MS Office Version:Excel Mac 2008, Excel 2007
Posts: 3
rajab is becoming part of the community
Re: Batch generation of jpgs from charts in Mac Office 2008

Thanks for the reply Andy. I don't see a scripting option in Mac Excel 2008 but it might be possible via the OS (Automator).

In any case, I can try it in Excel 2007. I'm new to VBA so I want to see if I can get some guidance on creating a script.

I found the following, which works for converting a chart into a jpg. How would I modify this script so it would go through all the tabs in a worksheet, saving all the charts as jpgs?

Your assistance is much appreciated.

Quote:
Sub DiagrammAlsJPGSpeichern()

Dim GDiagramm As Chart

Dim NameT As String

Const PfadDiagramm = "C:\"

Set GDiagramm = ActiveChart

NameT = InputBox("Name of Chart:", "Export Chart", ActiveChart.Name)

If NameT <> "" Then

GDiagramm.Export Filename:=PfadDiagramm & NameT & ".JPG", FilterName:="JPG"

End If

End Sub
Reply With Quote
  #4  
Old 06-26-2009, 05:49 AM
Andy Pope's Avatar
Andy Pope Andy Pope is offline
Forum Guru
 
Join Date: 10 May 2004
Location: Essex, UK
MS Office Version:2003 & 2007 sp2
Posts: 7,223
Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding
Re: Batch generation of jpgs from charts in Mac Office 2008

try this
Code:
Sub ExportChartSheets()
    Dim chtTemp As Chart
    Dim strFilename As String
    Dim strPath As String
    
    strPath = ThisWorkbook.Path & "\"
    For Each chtTemp In ThisWorkbook.Charts
        strFilename = strPath & chtTemp.Name & ".jpg"
        chtTemp.Export strFilename
    Next
    
End Sub
__________________
Cheers
Andy
www.andypope.info
Reply With Quote
  #5  
Old 06-30-2009, 01:52 AM
rajab rajab is offline
Registered User
 
Join Date: 24 Jun 2009
Location: Palo Alto, CA
MS Office Version:Excel Mac 2008, Excel 2007
Posts: 3
rajab is becoming part of the community
Thumbs up Re: Batch generation of jpgs from charts in Mac Office 2008

You are awesome Andy!

Thank you!
Reply With Quote


Reply

Bookmarks

Tags
apple , charting , jpeg , mac


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump