Bonjour,
j'ai trouvé ce code sur la FAQ pour créer un document Word
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
25
26
27 <% ' CREATE WORD DOCUMENT Set WordApp = CreateObject("word.application") Set WordDoc = WordApp.Documents.Add() WordApp.Application.Visible = False Set MyRange1 = WordDoc.Paragraphs.Add.Range MyRange1.InsertBefore("Appraisal Form") MyRange1.Style = "Heading 1" Set MyRange1 = WordDoc.Paragraphs.Add.Range MyRange1.InsertBefore("Manager: " & Manager & vbcrlf & "Appraisee: " & Appraisee) MyRange1.Font.Bold = true Set MyRange1 = WordDoc.Paragraphs.Add.Range MyRange1.InsertBefore(vbcrlf & "Please fill in all the required sections and return to HR via the internal mail system.") ' Set the directory location to store the generated documents WordDocPath = Server.MapPath("\alastair\appraisals\forms") ' Use the unique session ID as the filename. WordDoc.SaveAs WordDocPath & "\" & session.sessionID & ".doc" WordDoc.Close WordApp.Quit Set WordDoc = Nothing Set WordApp = Nothing %>
Est-il possible de faire la même chose avec Excel?
du style
Code : Sélectionner tout - Visualiser dans une fenêtre à part Set WordApp = CreateObject("excel.application")
Merci d'avance.
Partager