Guardar excel en .pdf

Buenas
Disculpen las molestias
Tengo un pequeño inconveniente con algo aquí y me gustaría ver si alguno me puede ayudar se lo agradecería mucho
Voy a la cuestión
Tengo la siguiente macro
Sub Guarda()
Dim dia As String
Dim tim As String
Dim nombre As String
Dim ext As String
Dim Path As String
dia = Format(Date, "dd-mm-yyyy ")
tim = Format(Time(), " hh-mm")
ext = ".xls"
nombre = Sheets(1).Range("h4").Value & ".xls"
MsgBox "Generada " & nombre
Path = "C:\Users\COMPUTOS\Desktop\pro\" & dia + nombre
ActiveWorkbook.SaveAs Filename:=Path, FileFormat:=xlNormal
End Sub
Y funciona perfectamente
Me gustaría hacer que en vez de guardar en excel lo haga en .pdf
Que cambios debo hacer o que comandos debo editarle.
Muchas gracias de antemano

1 respuesta

Respuesta
1
Prueba así:
Sub Guarda()
Dim dia As String
Dim tim As String
Dim nombre As String
Dim ext As String
Dim Path As String
dia = Format(Date, "dd-mm-yyyy ")
tim = Format(Time(), " hh-mm")
ext = ".xls"
nombre = Sheets(1).Range("h4").Value
MsgBox "Generada " & nombre
Path = "C:\Users\COMPUTOS\Desktop\pro\" & dia + nombre
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Path _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
End Sub

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas