Bonsoir à tous,
J'ai une macro sur mon ordinateur personnel, que j'ai exporté sur l'ordinateur de mon travail Sub envoi_PJ()
ChDir ActiveWorkbook.Path
répertoireAppli = ActiveWorkbook.Path Dim olapp As Outlook.Application
Sheets("destinataires").Select
[A12].Select
Do While Not IsEmpty(ActiveCell)
MsgCc = MsgCc & ActiveCell & ";"
MsgCci = MsgCci & ActiveCell & ";"
ActiveCell.Offset(1, 0).Select
Loop
Dim msg As MailItem
Set olapp = New Outlook.Application
Set msg = olapp.CreateItem(olMailItem)
msg.To = [A11].Value
'msg.CC = MsgCc
msg.BCC = MsgCci
msg.Subject = [A2]
msg.Body = [A5] & Chr(13) & Chr(13) & [A8].Value & Chr(13) & Chr(13)
[C8].Select
Do While Not IsEmpty(ActiveCell)
nf = ActiveWorkbook.Path & "\" & ActiveCell.Value
msg.Attachments.Add Source:=nf
ActiveCell.Offset(1, 0).Select
Loop
msg.Display 'Send
End SubVoici l'erreur de Visual Basic
"Erreur de compilation", "Type défini par l'utilisateur non défini".
Quelqu'un peut m'aider.
Bonjour le fil ,
Est-ce bien la bonne référence qui est activée (en fonction de la version d'Office).
Microsoft Outlook 12.0 Object Library pour 2007
Microsoft Outlook 11.0 Object Library pour 2003, etc.
Bon dimanche