Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default Print Charts

I have twelve workbooks that each contain 2 worksheets. One worksheet
contains data and the other contains a chart.

Is there a way that I can call up the individual workbooks and then print
out just the chart tab, save and call up the next workbook. All this done
with one Macro.

Thanks
Frank
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,365
Default Print Charts

Little doubt that it could be done. You could write code that lists all
workbook's complete paths/names and have it open them one at a time, find a
sheet with a chart on it (be nice if chart sheets all had same name), and
print the sheet within a loop.
Another way would be to have only those files in a specific folder and have
your macro simply access each .xls file in the folder in turn (except for
itself) and then do same process regarding finding the chart sheet(s) and
printing them.

"Beep Beep" wrote:

I have twelve workbooks that each contain 2 worksheets. One worksheet
contains data and the other contains a chart.

Is there a way that I can call up the individual workbooks and then print
out just the chart tab, save and call up the next workbook. All this done
with one Macro.

Thanks
Frank

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default Print Charts

give this one a try.
run this, then a dialog comes up and select a folder that has your files.
I presume your files are in a same folder. this would try to print every
graph in workbooks in the folder, as i'm not sure your graphs are in
worksheets or in graph sheet.

Sub printcharts()
Dim wb, fd
Dim sh As Worksheet
Dim chobj As ChartObject
Dim ch As Chart
Dim xlFile As String
Dim MyPath As String

Set fd = Application.FileDialog(msoFileDialogFolderPicker)

If fd.Show = -1 Then
MyPath = fd.SelectedItems(1)
Else
Exit Sub
End If
ChDir MyPath
xlFile = Dir("*.xls")
On Error Resume Next
Application.DisplayAlerts = False
Do While xlFile < ""
If ThisWorkbook.Name < xlFile Then
Set wb = Workbooks.Open(MyPath & _
Application.PathSeparator & xlFile)
End If
'print every worksheets that have graphs
For Each sh In worksheets
Set chobj = Nothing
Set chobj = sh.ChartObjects(1)
If Not chobj Is Nothing Then
sh.PrintOut 'preview:=True
End If
Next
'print every Graph sheets
For Each ch In Charts
ch.PrintOut 'preview:=True
Next
wb.Close SaveChanges:=False
xlFile = Dir
Loop
End Sub

keizi

"Beep Beep" wrote in message
...
I have twelve workbooks that each contain 2 worksheets. One worksheet
contains data and the other contains a chart.

Is there a way that I can call up the individual workbooks and then print
out just the chart tab, save and call up the next workbook. All this done
with one Macro.

Thanks
Frank


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Print charts in a 30 tab workbook bmac Charts and Charting in Excel 3 January 27th 09 04:31 AM
Print Specific Charts Petrov Charts and Charting in Excel 5 July 10th 07 03:20 PM
1 of 4 charts won't print Tina Charts and Charting in Excel 3 June 16th 05 11:33 PM
1 of 4 charts on page won't print Tina Charts and Charting in Excel 0 June 16th 05 02:12 AM
Need Help w/ Print Macro to Print All Visible Sheets (including Charts) in a Workbook will Excel Programming 3 September 23rd 04 08:05 PM


All times are GMT +1. The time now is 09:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"