#1
Hi,

Can anyone help to solve the below query.

1) How to Convert excel to PDF.
2) How to convert specific sheet in excel to PDF.

Above operation using automation anywhere tool.

Thanks
 
#2
Hi ,

You cannot convert excel sheet directly into a pdf using AA attributes.

You can do it by opening the excel , segregating the sheets by different excels and then convert the excel into pdf by clicking on Save as and click on more option wile saving and change the format to PDF and save.

Lets say you have 3 sheets which you want to convert into PDF, segregate these 3 sheets into different excel form using AA and then convert each excel into PDF and then use the PDF integration of AA to combine all 3 sheets into one sheet if you want.
This should help you resolve your problem.

Thanks
Siddanth Rao
 
#3
Use the below vbscript..


Private Sub CommandButton1_Click()
'BUTON CONVERSIE PDF - ANGAJATORI
'DESCRIPTION: CONVERSIE A UNUI SHEET IN PDF
Dim ThisRng As Range
Dim strfile As String
Dim myfile As Variant


'Selectie Sheet pentru conversie
Application.ScreenUpdating = False
ActiveWorkbook.Sheets("PDF ANG").Visible = True

'Selectie filtru pentru ce sa converteasca
ActiveWorkbook.Sheets("PDF ANG").Select
Selection.AutoFilter Field:=1, Criteria1:="<>" 'column A
Selection.AutoFilter Field:=5, Criteria1:="<>" 'column E

'Selectie raza pentru conversie
With ActiveWorkbook.Sheets("PDF ANG")
Set ThisRng = .Range("A2", .Cells(.Rows.Count, "F").End(xlUp))
End With

'Prompt for save location
strfile = "Selection" & "_" _
& Format(Now(), "yyyymmdd_hhmmss") _
& ".pdf"
strfile = ThisWorkbook.Path & "\" & strfile
myfile = Application.GetSaveAsFilename _
(InitialFileName:=strfile, _
FileFilter:="PDF Files (*.pdf), *.pdf", _
Title:="Select Folder and File Name to Save as PDF")
If myfile <> "False" Then 'save as PDF
ThisRng.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
myfile, Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=True
Else
MsgBox "No File Selected. PDF will not be saved", vbOKOnly, "No File Selected"
End If
ActiveWorkbook.Sheets("PDF ANG").ShowAllData
ActiveWorkbook.Sheets("PDF ANG").Visible = False

End Sub
 
Top