1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| Dim Img As Picture, Coeff As Single
Sheets("PDF").Activate
With Worksheets("PDF").PageSetup
.Orientation = xlPortrait
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
.PaperSize = xlPaperA4
End With
[A1].Select
Set Img = ActiveSheet.Pictures.Insert(REPERTOIRE & JPG)
With Img
Coeff = .Height / .Width
If Coeff > 1 Then
If .Height > 5431 Then
.Height = 5431
.Width = .Width / Coeff
End If
Else
If .Width > 3840 Then
.Height = .Heigh * Coeff
.Width = 3840
End If
End If
End With
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=REPERTOIRE & FichPDF, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=False |
Partager