ExportAsFixedFormat for Multiple Sheets in a Single Excel File

I

ivanL

It seems I can only save to PDF one sheet at a time, is it possible to print
multiple sheets in a single PDF document i.e. multiple page PDF?

Thanks.
 
R

Ron de Bruin

You can create a new workbook with the sheets you want

ActiveWorkbook.Sheets(Array("Sheet1", "Sheet3")).Copy

Am the make a pdf of the workbook and delete the temp file

Sub RDB_PDF_ActiveWorkbook()
Dim FilenameStr As String

If Dir(Environ("commonprogramfiles") & "\Microsoft Shared\OFFICE" _
& Format(Val(Application.Version), "00") & "\EXP_PDF.DLL") <> "" Then

FilenameStr = Application.DefaultFilePath & "\" & _
Format(Now, "dd-mmm-yy h-mm-ss") & ".pdf"

ActiveWorkbook.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=FilenameStr, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
MsgBox "You can find the PDF file here : " & FilenameStr

Else
MsgBox "PDF add-in Not Installed"
End If
End Sub
 
W

Wsg Dotnet

The example you mentioned in VBA format. how can I use this in asp.net 2005?
Help me to solve this.

Thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top