Bonjour,
Il faut trouver la propriété qui correspond au bouton radio 
"Sélection/Feuille(s) selectionnée(s) dans l'onglet Général de la 
fenêtre d'export.....
Bonne soirée,
JMC
Le 15/10/2021 à 17:41, Algol formations a écrit :
Bonjour à tous,
Je suis en train de construire une macro CALC pour exporter UNE SEULE 
FEUILLE au format PDF.
Tout est ok, sauf que la macro m'exporte TOUT le classeur !
Voilà le code :
Sub ExportPDF
    Dim oDoc As Object , Feuille As Object, Cellule As Object
    Dim Chemin As String, Fichier As String
    Dim ArgPdf(0) as new com.sun.star.beans.PropertyValue
    oDoc = ThisComponent
    Chemin = "D:\Libre Office\LOCalc\AFPP-Calc\Calc_spécial\" '----- 
Chemin de sauvegarde
    Feuille = oDoc.Sheets.getByName("facture") '----- nom de la feuille
    Cellule = Feuille.getCellRangeByName ("C2") '----- récupération du 
numéro de facture pour l'inclure dans le nom du PDF
    Fichier = Cellule.getString & ".pdf"
    ArgPdf(0).Name = "FilterName"
    ArgPdf(0).Value = "calc_pdf_Export"
    Msgbox Chemin & "\" & Fichier
    oDoc.storeToURL(convertToUrl(Chemin & Fichier),ArgPdf())
    MsgBox("Fin export pdf")
End sub
L'idéal serait de définir dans la macro une zone d'impression et de 
n'exporter que cette zone.
Mais je sèche !!
Merci de vos conseils
Michel
--
       Jean-Michel COSTE
--
Envoyez un mail à users+unsubscribe@fr.libreoffice.org pour vous désinscrire
Les archives de la liste sont disponibles à https://listarchives.libreoffice.org/fr/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Context
   
 
  Privacy Policy |
  
Impressum (Legal Info) |
  
Copyright information: Unless otherwise specified, all text and images
  on this website are licensed under the
  
Creative Commons Attribution-Share Alike 3.0 License.
  This does not include the source code of LibreOffice, which is
  licensed under the Mozilla Public License (
MPLv2).
  "LibreOffice" and "The Document Foundation" are
  registered trademarks of their corresponding registered owners or are
  in actual use as trademarks in one or more countries. Their respective
  logos and icons are also subject to international copyright laws. Use
  thereof is explained in our 
trademark policy.