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 32 33 34 35 36 37 38 39 40 41 42 43 44
|
Private Sub Commande5_Click()
Dim i As Integer
Dim dlgSaveAs As FileDialog
Dim chem As String
Dim strDateDébut As String
Dim strDateFin As String
strDateDébut = traitementDateSaisie(Me.Texte3.Value)
strDateFin = traitementDateSaisie(Me.Texte8.Value)
Set dlgSaveAs = Application.FileDialog(msoFileDialogSaveAs)
dlgSaveAs.Show 'boîte de dialoque de sauvegarde
If dlgSaveAs.ButtonName = "Enregistrer" Then:
chem = dlgSaveAs.SelectedItems(1)
Open chem + ".xls" For Output As #1
Close #1
Set appExcel = CreateObject("Excel.Application")
Set wbExcel = appExcel.Workbooks.Open(chem + ".xls")
Set wsExcel = wbExcel.Worksheets(1)
initialisationMyArray
initialisationTabFournisseur
miseEnFormeFichierExcel ' nom des colones
requeteRapportPcs strDateDébut, strDateFin
insertionDonnéeFichierExcel
Range(Cells(2, 1), Cells(20, 1)).Font.Bold = True
MsgBox ("Votre fichier est à prèsent disponible à l'emplacement :" + chem)
End Sub |
Partager