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
| Private Sub CBFUSION_Click()
Dim MonApplication As Object
Dim MonFichier As String
Dim DateConsult As String, nom As String, sauveg As String, prénom As String
'If MsgBox("Création du fichier FUSION.xls." & Chr(10) & "Puis fermerture ...Continuer ?", vbInformation + vbOKCancel, "Fermeture de cette application") = vbOK Then
Sheets("Victime").Select
[A2].Select
nom = ActiveCell
If nom = "" Then
nom = "Inconnu"
End If
[B2].Select
prénom = ActiveCell
[H2].Select
DateConsult = ActiveCell
sauveg = nom & "_" & prénom & "_"
'Application.DisplayAlerts = False
'Application.ScreenUpdating = True
Unload UFAccueil
MsgBox "La sauvegarde va démarrer"
ActiveWorkbook.SaveAs Filename:="C:\Users\Bureau\Excel_FUSION.xls"
ActiveWorkbook.SaveAs Filename:="C:\Users\Bureau\'" & sauveg & "'"
MsgBox "La sauvegarde est terminée"
Application.Quit 'pour fermer Excel et n'avoir que Word à l'écran
' Pour ouvrir Word afin de réaliser le PUBLIPOSTAGE ---
Dim doc, wordapp
Set wordapp = CreateObject("Word.application")
wordapp.ShowMe
wordapp.Visible = True
wordapp.documents.Open ("C:\Users\Bureau\PUBLIPOSTAGE.doc")
wordapp.Activate
Application.Quit
End Sub |
Partager