Good afternoon, I have this that works in Excel 2010 for a single worksheet.
Is there any way to do this with more than one sheet?
I've tried
but get
I found some other code for use with pdf printer
but that doesn't appear to help me much
I have found this on the Microsoft site:
But this seems to do just what I need!!
All I had to do was tweak the margins & set the Print Area! Simples.
Thank you for listening.
Many thanks,
D€$
Code:
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
direc_output & fname & ".pdf", Quality:= _
xlQualityStandard, IncludeDocProperties:=False, IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Is there any way to do this with more than one sheet?
I've tried
Code:
ActiveWorkbook.Sheets(Array("Report_FIRST_PAGE", "Report")).ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
direc_output & fname & ".pdf", Quality:= _
xlQualityStandard, IncludeDocProperties:=False, IgnorePrintAreas:=False, _
OpenAfterPublish:=False
but get
Run-time error '438':
Object doesn't support this property or method
I found some other code for use with pdf printer
Code:
ObjXL.ActiveWorkbook.Sheets(Array("sheet1", "sheet2",
"sheet3")).PrintOut , collate:=True
but that doesn't appear to help me much
I have found this on the Microsoft site:
Code:
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF FileName:="sales.pdf" Quality:=xlQualityStandard DisplayFileAfterPublish:=True
But this seems to do just what I need!!
Code:
direc_output = "G:\Users\Des.Lavender\Excel\"
fname = "Test2"
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
direc_output & fname & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
All I had to do was tweak the margins & set the Print Area! Simples.
Thank you for listening.
Many thanks,
D€$