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.
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"
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.
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
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
You are awesome Andy!
Thank you!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks