A voir également:
- Ou mettre les macro VBA ?
- Telecharger macro convertir chiffre en lettre excel - Télécharger - Tableur
- Jitbit macro recorder - Télécharger - Confidentialité
- Télécharger macro convertir chiffre en lettre excel - Télécharger - Tableur
- Macro word - Guide
- Excel compter cellule couleur sans vba - Guide
1 réponse
Salut,
une macro peut être mise dans le classeur courant ou dans le classeur commun à excel (perso.xls, qui est un classeur caché).
Pour ce qui est de la résolution des références, pas de miracle à attendre du côté de la macro, seule l'installation correcte des différents composants auxquels tu accèdes (outlook, word...) garantit le fonctionnement...
une macro peut être mise dans le classeur courant ou dans le classeur commun à excel (perso.xls, qui est un classeur caché).
Pour ce qui est de la résolution des références, pas de miracle à attendre du côté de la macro, seule l'installation correcte des différents composants auxquels tu accèdes (outlook, word...) garantit le fonctionnement...
Par contre, la macro marche tres bien sur la pluspart des postes ou j ai tester sauf sur certains ordi portable
sinon voila la macro, c pas tres propre mais ca marche ,
Sub ValidationSaisie()
Range("f10").Select
If ActiveCell = "" Or ActiveCell < 4 Then
ActiveWorkbook.Save
'Range("a42 ").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
MsgBox "- Vérifier Formulaire" & vbCrLf & "- Récupérer impression" & vbCrLf & "- Envoyer mail", vbInformation, "CM CIC Marchés"
' & vbCrlf & ou & Chr(13) & ou & Chr(10)& = permet de passer à la ligne
'Range("'Cap&Floor'!C3").Select
Dim outlap2 As New Outlook.Application
Dim outmail2 As mailitem
Set outlap2 = New Outlook.Application
Set outmail2 = outlap2.createitem(olMailItem)
With outmail2
.To = Range("'listes'!C3").Value
.CC = Range("'listes'!C4").Value
.Subject = Range("'listes'!C5").Value
'.Body = Range("'listes'!C6").Value
.Body = vbCrLf & vbCrLf & "Bonjour," & vbCrLf & vbCrLf & "Veuillez trouvez ci joint le formulaire descriptif du deal, " & vbCrLf & "cordialement,"
.ReadReceiptRequested = True
.Attachments.Add ActiveWorkbook.FullName
'.Send
.Display
End With
'test ========== de la copie word et imprim pre conf'
Sheets("listes").Visible = True
Sheets("confirm").Visible = True
Sheets("confirm").Select
Range("a1:h83").Copy
'Sheets("collar").Select
Set WW = CreateObject("word.application")
WW.Visible = True
WW.documents.Add
'''' mise en page word
WW.Selection.Paste Special
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Application.CutCopyMode = False
'i = InputBox("nom du fichier ???")
''''''''''''WW.ActiveDocument.SaveAs "C:\Preconfirmation.doc"
'WW.ActiveDocument.SaveAs "C:\Preconfirmation.doc"
'With Application
'MonUserActif = UserName
'End With
'WW.Tables(1).AutoFitBehavior wdAutoFitWindow
' Selection.PageSetup.LeftMargin = 2
'.LeftMargin = Application.InchesToPoints
Dim hhh As String
Dim nomfich As String
hhh = Now
nomfich = "\preconf " & hhh & ".doc"
nomfich = Replace(nomfich, "/", "_") ', Replace(nomfich, ":", "_")
nomfich = Replace(nomfich, ":", "_")
'MsgBox " mon nom user is : " & Mondoss
'''''''''bonnne ==== WW.ActiveDocument.SaveAs Path & "\preconf.doc"
WW.ActiveDocument.SaveAs Path & nomfich
'Range("a42 ").Select
'WW.objectSelect
'ActiveWorkbook.Close
'Fin test de la copie word et imprim pre conf'
'Documents.SaveAs ("C:\Documents and Settings\USER\PreconfCli")
'WW.Documents.Add App.Path & "\Preconf.doc"
'With outmail2
'.Attachments.Add WW
'End With
'''''''''''test mail 2
Dim myattachments As Variant
Dim outlap3 As New Outlook.Application
Dim outmail3 As mailitem
Set outlap3 = New Outlook.Application
Set outmail3 = outlap3.createitem(olMailItem)
With outmail3
.To = "xxx"
'.CC =
.Subject = nomfich
'.Body = Range("'listes'!C6").Value
.Body = vbCrLf & vbCrLf & "Bonjour," & vbCrLf & vbCrLf & "Veuillez trouvez ci joint la génération automatique de préconfirmation, " & vbCrLf & "cordialement,"
.ReadReceiptRequested = True
'.WW.Attachments.Add nomfich
'.Attachments.Add ActiveWorkbook.FullName
.Attachments.Add Path & "\" & nomfich
'.Send
.Display
End With
'''''''''''''''''''''''''''''' fin de test
Sheets("listes").Visible = False
Sheets("confirm").Visible = False
Sheets("Cap&Floor").Select
Range("e7").Select
Else
MsgBox "VALIDATION INCOMPLETE",vbExclamation, "xxxMarchés"
End If
'Set XL = Excel.Application
'XL.Visible = True
End Sub