Bonjour à tous,

Je créé un fichier une fois par jour automatiquement avec une tache planifiée. Mais je voudrais enregistrer le fichier sans les macros.

Comment faire ?

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 
ActiveWorkbook.RefreshAll
 
    ActiveWorkbook.Save
 
    jour = Day(Now) & "_" & Month(Now) & "_" & Year(Now) & "_" & Hour(Now) & "_" & Minute(Now)
    monfichier = "C:\XLS_1\" & "Export" & " " & jour
 
    monfichier = monfichier & ".xls"
 
    ChDir "c:\XLS_1\"
    With Application
    .DisplayAlerts = False
    .EnableEvents = False
    ActiveWorkbook.SaveCopyAs Filename:=monfichier
    .EnableEvents = True
    .DisplayAlerts = True
 
    Set mailobj = CreateObject("Outlook.Application")
    Set mail = mailobj.CreateItem(olMailItem)
 
 
    With mail
    .SentOnBehalfOfName = SentOnName