Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default PDF export add-in

I am using a macro to loop through several workbooks and publish
selected sheets to PDF. The sheets have both tables and charts and are
scaled at about 85% to fit on a single page.

The PDFs retain the correct print area/scaling size, the problem is
the the charts seem to stay at 100% so they end up being cut-off.
Below is the macro code I use. Any ideas?

Sub pdf()
'
' pdf Macro
'

'
Sheets(Array("Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5",
"Sheet6")).Select
Sheets("Sheet6").Activate
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\WORK\Template.pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True,
IgnorePrintAreas _
:=False, OpenAfterPublish:=False
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default PDF export add-in

Hi

This is a known problem and as far as I know there is no fix

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"gbruintjes" wrote in message ...
I am using a macro to loop through several workbooks and publish
selected sheets to PDF. The sheets have both tables and charts and are
scaled at about 85% to fit on a single page.

The PDFs retain the correct print area/scaling size, the problem is
the the charts seem to stay at 100% so they end up being cut-off.
Below is the macro code I use. Any ideas?

Sub pdf()
'
' pdf Macro
'

'
Sheets(Array("Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5",
"Sheet6")).Select
Sheets("Sheet6").Activate
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\WORK\Template.pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True,
IgnorePrintAreas _
:=False, OpenAfterPublish:=False
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default PDF export add-in

A possible fix - just before exporting to PDF, what if you convert the chart
to a picture (either metafile or bitmap) and print that instead? Would it
print out correctly then, or still get cut off?

For example:

'
' Convert_Chart_to_Picture Macro
' For a chart on a worksheet
'
Sub Convert_Chart_to_Picture()
'
Sheets("Sheet1").Select
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.CopyPicture Appearance:=xlPrinter, Size:=xlPrinter, Format:= _
xlPicture
Sheets("Sheet2").Select
ActiveSheet.PasteSpecial Format:="Picture (Enhanced Metafile)",
Link:=False _
, DisplayAsIcon:=False
Selection.ShapeRange.Left = 0#
Selection.ShapeRange.Top = 0#
End Sub
'
' Convert_Chart_to_Picture Macro
' For a chart on its own sheet
'
Sub Convert_Chart_to_Picture2()
Sheets("Chart1").Select
ActiveChart.CopyPicture Appearance:=xlPrinter, Format:=xlPicture
Sheets("Sheet2").Select
ActiveSheet.PasteSpecial Format:="Picture (Enhanced Metafile)",
Link:=False _
, DisplayAsIcon:=False
Selection.ShapeRange.Left = 0#
Selection.ShapeRange.Top = 0#
End Sub

You could also scale the size of the picture to ensure it fits the PDF page
if necessary.

HTH,

Eric

"Ron de Bruin" wrote:

Hi

This is a known problem and as far as I know there is no fix

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"gbruintjes" wrote in message ...
I am using a macro to loop through several workbooks and publish
selected sheets to PDF. The sheets have both tables and charts and are
scaled at about 85% to fit on a single page.

The PDFs retain the correct print area/scaling size, the problem is
the the charts seem to stay at 100% so they end up being cut-off.
Below is the macro code I use. Any ideas?

Sub pdf()
'
' pdf Macro
'

'
Sheets(Array("Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5",
"Sheet6")).Select
Sheets("Sheet6").Activate
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\WORK\Template.pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True,
IgnorePrintAreas _
:=False, OpenAfterPublish:=False
End Sub


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
Export Excel tuncating leading zeros while export to excel from da RHBKV Setting up and Configuration of Excel 1 July 15th 09 01:48 PM
Chart.Export images are shrinking as I export more images Jared Charts and Charting in Excel 3 January 29th 08 03:23 AM
export re-order input fields to export file [csv] madisonpete Excel Worksheet Functions 0 November 30th 07 03:51 PM
export as csv Ashok Setting up and Configuration of Excel 2 May 29th 06 12:08 PM
CSV export help mainemike Excel Discussion (Misc queries) 1 February 22nd 06 07:13 PM


All times are GMT +1. The time now is 08:20 PM.

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

About Us

"It's about Microsoft Excel"