Excel-MAC : Enregistrer en pdf
Fermé
Thoms29
Messages postés
3
Date d'inscription
mercredi 3 juin 2015
Statut
Membre
Dernière intervention
4 juin 2015
-
Modifié par Thoms29 le 3/06/2015 à 09:17
Thoms29 Messages postés 3 Date d'inscription mercredi 3 juin 2015 Statut Membre Dernière intervention 4 juin 2015 - 3 juin 2015 à 09:30
Thoms29 Messages postés 3 Date d'inscription mercredi 3 juin 2015 Statut Membre Dernière intervention 4 juin 2015 - 3 juin 2015 à 09:30
A voir également:
- Excel-MAC : Enregistrer en pdf
- Liste déroulante excel - Guide
- Adresse mac - Guide
- Nettoyer mac - Guide
- Formule excel - Guide
- @ Sur mac - Guide
1 réponse
Thoms29
Messages postés
3
Date d'inscription
mercredi 3 juin 2015
Statut
Membre
Dernière intervention
4 juin 2015
3 juin 2015 à 09:30
3 juin 2015 à 09:30
Oui j'ai un logiciel pdf puisque je peux enregistrer ma feuille excel sous forme de PDF de maniere manuelle.
Mon code est le suivant, la partie pour Mac est dans le Else :
Sub PrintPDF2()
Dim wksSheet As Worksheet
Dim TheOS As String
Dim strPath As String
Dim myFile As Variant
Dim strFile As String
TheOS = Application.OperatingSystem
If InStr(1, TheOS, "Windows") > 0 Then
Set wksSheet = ActiveSheet
'enter name and select folder for file
' start in current workbook folder
strFile = Replace(Replace(wksSheet.Cells(1, 2).Value, " ", ""), ".", "_") _
& "_" _
& Format(Now(), "yyyymm") _
& ".pdf"
strFile = ThisWorkbook.Path & "\" & strFile
myFile = Application.GetSaveAsFilename _
(InitialFileName:=strFile, _
FileFilter:="PDF Files (*.pdf), *.pdf", _
Title:="Select Folder and FileName to save")
If myFile <> "False" Then
ws.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=myFile, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
MsgBox "PDF file has been created."
End If
exitHandler:
Exit Sub
Else
Set wksSheet = ActiveSheet
strFile = Replace(Replace(wksSheet.Cells(1, 2).Value, " ", ""), ".", "_") _
& "_" _
& Format(Now(), "yyyymm") _
& ".pdf"
strFile = ThisWorkbook.Path & ":" & strFile
myFile = Application.GetSaveAsFilename _
(InitialFileName:=strFile, _
FileFilter:="PDF Files (*.pdf), *.pdf", _
Title:="Select Folder and FileName to save")
Exit Sub
End If
End Sub
Mon code est le suivant, la partie pour Mac est dans le Else :
Sub PrintPDF2()
Dim wksSheet As Worksheet
Dim TheOS As String
Dim strPath As String
Dim myFile As Variant
Dim strFile As String
TheOS = Application.OperatingSystem
If InStr(1, TheOS, "Windows") > 0 Then
Set wksSheet = ActiveSheet
'enter name and select folder for file
' start in current workbook folder
strFile = Replace(Replace(wksSheet.Cells(1, 2).Value, " ", ""), ".", "_") _
& "_" _
& Format(Now(), "yyyymm") _
& ".pdf"
strFile = ThisWorkbook.Path & "\" & strFile
myFile = Application.GetSaveAsFilename _
(InitialFileName:=strFile, _
FileFilter:="PDF Files (*.pdf), *.pdf", _
Title:="Select Folder and FileName to save")
If myFile <> "False" Then
ws.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=myFile, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
MsgBox "PDF file has been created."
End If
exitHandler:
Exit Sub
Else
Set wksSheet = ActiveSheet
strFile = Replace(Replace(wksSheet.Cells(1, 2).Value, " ", ""), ".", "_") _
& "_" _
& Format(Now(), "yyyymm") _
& ".pdf"
strFile = ThisWorkbook.Path & ":" & strFile
myFile = Application.GetSaveAsFilename _
(InitialFileName:=strFile, _
FileFilter:="PDF Files (*.pdf), *.pdf", _
Title:="Select Folder and FileName to save")
Exit Sub
End If
End Sub