bonjour,

j'ai un petit problème avec la sauvegarde de fichier excel.
j'ai été voir la FAQ mais malgrès son aide je n'y parviens pas .

je m'explique , j'ouvre via access 2000 un fichier modèle .xlt dans lequel je copie mes données et j'aimerais le sauvegarder dans un repertoire connu.

pour cela je ne peux pas faire Objet.save mais Objet.SaveAs, mais ça ne marche pas , il me marque l'erreur 438
objet doesn't support this property or methode
je ne comprend plus !!!


pour info voici mon code
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
28
29
30
31
Dim App As Object
Dim maxligne, numligne, onligne As Long
Dim i As Integer
Dim popol As String
On Error GoTo Err_Extract_value
 
    Application.Screen.MousePointer = 11
    Set App = CreateObject("Excel.application")
App.Workbooks.Open "C:\Documents and Settings\Essais_extract.xlt"  ,, False
 
    strSQL = "select RFW_Tab.RFW_ref, RFW_Tab.Directorate, RFW_Tab.Groupe, RFW_Tab.RFW_issue, RFW_Tab.Orient_screening, RFW_Tab.DR_committed, RFW_Tab.DR_agreed, RFW_Tab.AL_wished_target, RFW_Tab.MISP_closure_plan, RFW_Tab.MISP_closed, RFW_Tab.Closed_date from RFW_Tab order by RFW_issue;"
 
    Set rst = CurrentDb.OpenRecordset(strSQL)
    If Not rst.EOF Then
        rst.MoveLast
        rst.MoveFirst
        maxligne = rst.RecordCount
        App.Sheets("Extract_1").Select
        With App.Worksheets("Extract_1")
            For numligne = 2 To maxligne + 1
                For i = 0 To 10
                    .Cells(numligne, i + 1) = rst(i).Value
                Next i
            rst.MoveNext
            Next numligne
        End With
    End If
    rst.Close
 
    Application.Screen.MousePointer = 0
App.SaveAs "C:\Documents and Settings\Essais_extract.xls"