Hello all,
I have been searching during 2 days for this problem I have.
I need to save an Excel form into .PDF format using a cell value. I've tried everything I could see on different forums, I and just don't know why it doesn't work.
I'm using a first sub macro to choose a path (that works fine), and when the execution arrives at the save as PDF, it gives me an error. (By the way, I am using sub multiple marcros)
Here is the code that I am using for the two macros:
Sub FileDialogMethod_01()
Dim v As Variant
Dim wb As Workbook
Dim newPath As String
With Application.FileDialog(msoFileDialogFolderPicker)
.Title = "ÉTAPE1: selection du dossier"
.AllowMultiSelect = False
If .Show = True Then
newPath = .SelectedItems(1) & "\"
Else
MsgBox "Annuler tout"
End If
End With
End Sub
*****************up to this point, it works fine...then the following is not working!************************
Sub SaveAsPDF()
s = Range("n5").Value
Activeworkbood.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _
s, Quality:=xlQualityStandard, IncludeDocProperties _
:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
End Sub
Thank you
cmartel815
Bookmarks