dirakocha a écrit a écrit :
No idea ??
|
Essaye sur www.notes.net (tu fais une recherche dasn le forum y a pas mal d'exemples)
sinon un petit exemple
Dim OLEapplication As Variant
Dim OLEbook As Variant
Dim OLEsheet As Variant
On Error Goto Oops
Set OLEapplication = Nothing
Set OLEbook = Nothing
Set OLEsheet = Nothing
'creation d'un doc XL
' xlsheet=1
Set OLEapplication = CreateObject("Excel.Application" )
Set OLEbook = OLEapplication .Workbooks.Add
Set OLEsheet = OLEbook.WorkSheets(1)
pathXL$=OLEapplication.path
i&=1
Set doc=view.getfirstdocument
ligXL%=1
colXL%=1
While Not doc Is Nothing
OLEsheet.cells(ligXL%,colXL%).value = doc.Subject(0)
ligXL%=ligXL%+1
Set doc=col.getnextdocument(doc)
Wend
path$="c:\"
file$="ExportXL.xls"
pathfile$=path$+file$
Call OLEbook.SaveAs(pathfile$,True)
Msgbox "File save on " + pathfile$
'Et ne pas oublier de fermer à la fin
Call OLEapplication.Quit
'vide le contenu des objets OLE
Set OLEapplication = Nothing
Set OLEbook = Nothing
Set OLEsheet = Nothing
'running Xl
apprun$ = pathXL$ + "\" + "Excel.exe" + " " + Chr(34) + pathfile$ + Chr(34)
taskid% = Shell(apprun$ ,3)