PDA

View Full Version : [SOLVED:] Print hidden chart



Juriemagic
10-27-2015, 03:16 AM
Hi good people,

My sheet contains some data tables on the left, and a chart is on the right. However when we print this sheet, it is desired to have the sheet printed as portrait. so, what I did was make a copy of the chart and placed it underneath the data tables. VBA makes this chart invisible, so looking at the sheet reveals the data on the left and the chart on the right. Printing however, must contain the data tables and the chart underneath. But the chart is invisible. Please could someone assist me in getting this hidden chart to print?. What I preferably do not want, is for the chart to become visible, print, and then go invisible again...is there a way?..all and any help will be greatly appreciated!!. Thank you all kindly!

Leith Ross
10-27-2015, 01:49 PM
Hello Juriemagic,

Your post is short on details of the printing procedure. You would need VBA to control the sheet printing like through a button on a worksheet.

If you have a single Chart on the the worksheet. You would need to add the following to VBA macro that prints out the sheet. Change "Sheet1" to match the name of the sheet the Chart is on.



Worksheets("Sheet1").ChartObjects(1).PrintObject = True

Juriemagic
10-27-2015, 11:11 PM
Hello Leith Ross,

please accept my apology for being so vague. Here is the code I use:

If Application.Dialogs(xlDialogPrinterSetup).Show = True Then
ActiveSheet.PrintOut

What I have done was select the print area by using page breaks. The tables AND the invisible graph need to be printed. Currently the space where the graph must print, is blank.

Aflatoon
10-28-2015, 03:08 AM
If the chart is not visible, it will not print.

Juriemagic
10-28-2015, 03:15 AM
thanx Aflatoon...may I ask....If I make the chart visible, BUT cover it with a shape form, is there a way maybe to have vba print the tables and the graph, ignoring the "cover"..I guess not?

Aflatoon
10-28-2015, 04:35 AM
If you uncheck the topmost shape's Print Object property, it should work.

Juriemagic
10-28-2015, 05:49 AM
Perfect!..Thank you very very much!