Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help writing code to print a chart in excel from access

Status
Not open for further replies.

daddypost

Technical User
Oct 21, 2004
98
US
I've got a workbook called "Last eight periods chart". In this I have a pivot table linked to data in my mdb. I've gotten around the auto refresh dialog box by refreshing the workbook through code. However, now I need to print the chart to a pdf file. I cannot get anything to work. The chart is on a sheet labeled chart1, the pivot table is on sheet1. I need help. Thanks for any advice you can give me. here is the code that refreshes.
Dim xl As Excel.Application


Set xl = CreateObject("excel.Application")

xl.Workbooks.Open ("C:\last eight periods chart.xls") ' substitute your file here
xl.Visible = True
xl.DisplayAlerts = False
xl.ActiveWorkbook.RefreshAll
 
printing to pdf requires, of course, a pdf printer 'driver'. Thereafter, the printing is not much different than any other printer (except, of course - again) you need to supply the file name of the print image.

Having successfully not resolved that issue, one wonders why the transit through Excel land. The "Chart" thinggyyyy in Excel is the same as hte one in Ms. A. it hust has a different / smaller interface. so if the data is in Ms. A. to begin with ther excursion to Excel is not really all that useful.




MichaelRed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top