Compléments pour Microsoft Access

http://access.fr.free.fr/

Imprimer fichier Excel (Automation)

Description 

Cette fonction permet d'imprimer un fichier Excel.

Remarque : Pour fonctionner, il faudra rajouter la référence "Microsoft Excel x.xx Object Library".

 
Synthaxe 

PrintFileExcel (strDirFile)

La synthaxe de la fonction PrintFileExcel comprend l'élément suivant :

ElémentsDescription

strDirFile

Expression de chaîne correspondant au chemin complet et au nom du fichier Excel que l'on souhaite imprimer.
 
Exemple 

Aucun exemple disponible pour le moment.

 
Code de la fonction 


Function PrintFileExcel(strFile As String)

Dim appXl As Excel.Application

Set appXl = CreateObject("Excel.Application")

With appXl
    .Workbooks.Open strFile
    .ActiveWorkBook.PrintOut
    .Quit
End With

Set appXl = Nothing

End Function