planifier une impression

pobrouwers

XLDnaute Occasionnel
Bonsoir le forum,

Est-il possible de planifier l'impression d'un classeur excel à une heure précise de facon journalière ?
J'ai essayé avec le planificateur des taches de windows et Application.OnTime TimeValue('18:25:30'),'ma_macro_print_', true dans une macro mais ca ne fonctionne pas.
Une idée ?
D'avance merci.
 
V

Visitor

Guest
Hi the forum

Sorry for my english, but french isn't my native language.

Function : Application.OnTime

This Method is what we can use to achieve the automatically running of Excel Macros. Let's suppose we have a macro that we wish to Run each day at 15:00 (3:00 PM). The first problem will be how to kick-off the OnTime Method. This we can do via the Workbook Open Event. The fastest way to get to the Private Module of the Workbook Object (ThisWorkbook) is to right click on the Excel icon next to 'File' and select 'View Code'

Private Sub Workbook_Open()
Application.OnTime TimeValue('15:00:00'), 'MyMacro'
End Sub

Where MyMacro is the name of the macro you wish to run and resides in a Standard Module and has the OnTime Method again like below

Sub MyMacro()

Application.OnTime TimeValue('15:00:00'), 'MyMacro'
'YOUR CODE

End Sub

This will run the Procedure MyMacro at 15:00 each day.

I hope this will be correct
 

Discussions similaires

Statistiques des forums

Discussions
312 331
Messages
2 087 352
Membres
103 526
dernier inscrit
HEC