Oups.
.Pictures.Insert("c:image.jpeg").Select
Daniel
"Excell" a écrit dans le message de news:
j'ai toujours le meme message d'erreur,
désolé
Le Thu, 20 Dec 2007 14:15:31 +0100, Daniel.C a
écrit:Tu insères l'image sur la feuille d'origine, pas sur le classeur que tu
mets
en pièce jointe.
Modifie :
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
End With
en :
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
.Range("L3").Select
.Picture.Insert ("c:image.jpeg")
End With
Modifie le "L3" pour positionner la signature sur la feuille.
Daniel
"Excell" a écrit dans le message de news:voici la nouvelle version du code
Sub Button16_Click()
'Working in 2000-2007
Dim Source As Range
Dim Dest As Workbook
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long
Dim OutApp As Object
Dim OutMail As Object
Set Source = Nothing
On Error Resume Next
Set Source = Range("a1:u44").SpecialCells(xlCellTypeVisible)
Range("L3").Select
ActiveSheet.Picture.Insert ("c:image.jpeg")
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.Picture = picpicture
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
On Error GoTo 0
If Source Is Nothing Then
MsgBox "blabala.....", vbOKOnly
Exit Sub
End If
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
'Set
wb = Sheets("Rapports").Range("c3") 'ActiveWorkbook
Set Dest = Workbooks.Add(xlWBATWorksheet)
Source.Copy
' Range("L3").Select
' ActiveSheet.Picture.Insert ("c:image.jpeg")
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
end With
TempFilePath = Environ$("temp") & ""
TempFileName = "Rapport hebdomadaire de " & wb '.Name & " " &
Format(Now, "dd-mmm-yy h-mm-ss")
If Val(Application.Version) < 12 Then
'You use Excel 2000-2003
FileExtStr = ".xls": FileFormatNum = -4143
End If
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
With Dest
.SaveAs TempFilePath & TempFileName & FileExtStr,
FileFormat:=FileFormatNum
On Error Resume Next
With OutMail
.To = "adressemail"
.cc = ""
.BCC = ""
.Subject = "Rapport hebdomadaire"
.Body = "Bonjour, voici mon rapport hebdomadaire. " & wb
.Attachments.Add Dest.FullName
.Display
End With
On Error GoTo 0
.Close savechanges:úlse
End With
Kill TempFilePath & TempFileName & FileExtStr
Set OutMail = Nothing
Set OutApp = Nothing
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
Là ou j'ai mis les lignes pour l'image(14 eme ligne),ok le document
est
envoyé sans l'image
ailleurs(ou en plus des lignes 14 et 15), comme celles mises en
commentaire sur ce code, j'ai une erreur et excell me dit "erreur
d'execution'438':propriete et methode non gérée par cet objet" et le
debogage va sur la ligne
ActiveSheet.Picture.Insert ("c:image.jpeg")
Le Thu, 20 Dec 2007 12:45:19 +0100, Daniel.C
a
écrit:Bonjour.
L'image doit être collée dans le classeur mis en pièce jointe.
Poste ton code modifié.
Daniel
"Excell" a écrit dans le message de news:Bonjour,
apres beeaucoup d'essai, l'image n'apparait jamais.
La je coinces
merci pour l'aide
RP
le client e-mail révolutionnaire d'Opera : http://www.opera.com/mail/
--
Utilisant le client e-mail révolutionnaire d'Opera :
http://www.opera.com/mail/
Oups.
.Pictures.Insert("c:image.jpeg").Select
Daniel
"Excell" <test@happymany.net> a écrit dans le message de news:
op.t3m02qtjkiwcv4@romu-b9b4abcecb...
j'ai toujours le meme message d'erreur,
désolé
Le Thu, 20 Dec 2007 14:15:31 +0100, Daniel.C <dZZZcolardelle@free.fr> a
écrit:
Tu insères l'image sur la feuille d'origine, pas sur le classeur que tu
mets
en pièce jointe.
Modifie :
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
End With
en :
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
.Range("L3").Select
.Picture.Insert ("c:image.jpeg")
End With
Modifie le "L3" pour positionner la signature sur la feuille.
Daniel
"Excell" <test@happymany.net> a écrit dans le message de news:
op.t3mwm1bckiwcv4@romu-b9b4abcecb...
voici la nouvelle version du code
Sub Button16_Click()
'Working in 2000-2007
Dim Source As Range
Dim Dest As Workbook
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long
Dim OutApp As Object
Dim OutMail As Object
Set Source = Nothing
On Error Resume Next
Set Source = Range("a1:u44").SpecialCells(xlCellTypeVisible)
Range("L3").Select
ActiveSheet.Picture.Insert ("c:image.jpeg")
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.Picture = picpicture
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
On Error GoTo 0
If Source Is Nothing Then
MsgBox "blabala.....", vbOKOnly
Exit Sub
End If
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
'Set
wb = Sheets("Rapports").Range("c3") 'ActiveWorkbook
Set Dest = Workbooks.Add(xlWBATWorksheet)
Source.Copy
' Range("L3").Select
' ActiveSheet.Picture.Insert ("c:image.jpeg")
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
end With
TempFilePath = Environ$("temp") & ""
TempFileName = "Rapport hebdomadaire de " & wb '.Name & " " &
Format(Now, "dd-mmm-yy h-mm-ss")
If Val(Application.Version) < 12 Then
'You use Excel 2000-2003
FileExtStr = ".xls": FileFormatNum = -4143
End If
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
With Dest
.SaveAs TempFilePath & TempFileName & FileExtStr,
FileFormat:=FileFormatNum
On Error Resume Next
With OutMail
.To = "adressemail"
.cc = ""
.BCC = ""
.Subject = "Rapport hebdomadaire"
.Body = "Bonjour, voici mon rapport hebdomadaire. " & wb
.Attachments.Add Dest.FullName
.Display
End With
On Error GoTo 0
.Close savechanges:úlse
End With
Kill TempFilePath & TempFileName & FileExtStr
Set OutMail = Nothing
Set OutApp = Nothing
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
Là ou j'ai mis les lignes pour l'image(14 eme ligne),ok le document
est
envoyé sans l'image
ailleurs(ou en plus des lignes 14 et 15), comme celles mises en
commentaire sur ce code, j'ai une erreur et excell me dit "erreur
d'execution'438':propriete et methode non gérée par cet objet" et le
debogage va sur la ligne
ActiveSheet.Picture.Insert ("c:image.jpeg")
Le Thu, 20 Dec 2007 12:45:19 +0100, Daniel.C <dZZZcolardelle@free.fr>
a
écrit:
Bonjour.
L'image doit être collée dans le classeur mis en pièce jointe.
Poste ton code modifié.
Daniel
"Excell" <test@happymany.net> a écrit dans le message de news:
op.t3msp1pnkiwcv4@romu-b9b4abcecb...
Bonjour,
apres beeaucoup d'essai, l'image n'apparait jamais.
La je coinces
merci pour l'aide
RP
le client e-mail révolutionnaire d'Opera : http://www.opera.com/mail/
--
Utilisant le client e-mail révolutionnaire d'Opera :
http://www.opera.com/mail/
Oups.
.Pictures.Insert("c:image.jpeg").Select
Daniel
"Excell" a écrit dans le message de news:
j'ai toujours le meme message d'erreur,
désolé
Le Thu, 20 Dec 2007 14:15:31 +0100, Daniel.C a
écrit:Tu insères l'image sur la feuille d'origine, pas sur le classeur que tu
mets
en pièce jointe.
Modifie :
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
End With
en :
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
.Range("L3").Select
.Picture.Insert ("c:image.jpeg")
End With
Modifie le "L3" pour positionner la signature sur la feuille.
Daniel
"Excell" a écrit dans le message de news:voici la nouvelle version du code
Sub Button16_Click()
'Working in 2000-2007
Dim Source As Range
Dim Dest As Workbook
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long
Dim OutApp As Object
Dim OutMail As Object
Set Source = Nothing
On Error Resume Next
Set Source = Range("a1:u44").SpecialCells(xlCellTypeVisible)
Range("L3").Select
ActiveSheet.Picture.Insert ("c:image.jpeg")
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.Picture = picpicture
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
On Error GoTo 0
If Source Is Nothing Then
MsgBox "blabala.....", vbOKOnly
Exit Sub
End If
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
'Set
wb = Sheets("Rapports").Range("c3") 'ActiveWorkbook
Set Dest = Workbooks.Add(xlWBATWorksheet)
Source.Copy
' Range("L3").Select
' ActiveSheet.Picture.Insert ("c:image.jpeg")
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
end With
TempFilePath = Environ$("temp") & ""
TempFileName = "Rapport hebdomadaire de " & wb '.Name & " " &
Format(Now, "dd-mmm-yy h-mm-ss")
If Val(Application.Version) < 12 Then
'You use Excel 2000-2003
FileExtStr = ".xls": FileFormatNum = -4143
End If
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
With Dest
.SaveAs TempFilePath & TempFileName & FileExtStr,
FileFormat:=FileFormatNum
On Error Resume Next
With OutMail
.To = "adressemail"
.cc = ""
.BCC = ""
.Subject = "Rapport hebdomadaire"
.Body = "Bonjour, voici mon rapport hebdomadaire. " & wb
.Attachments.Add Dest.FullName
.Display
End With
On Error GoTo 0
.Close savechanges:úlse
End With
Kill TempFilePath & TempFileName & FileExtStr
Set OutMail = Nothing
Set OutApp = Nothing
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
Là ou j'ai mis les lignes pour l'image(14 eme ligne),ok le document
est
envoyé sans l'image
ailleurs(ou en plus des lignes 14 et 15), comme celles mises en
commentaire sur ce code, j'ai une erreur et excell me dit "erreur
d'execution'438':propriete et methode non gérée par cet objet" et le
debogage va sur la ligne
ActiveSheet.Picture.Insert ("c:image.jpeg")
Le Thu, 20 Dec 2007 12:45:19 +0100, Daniel.C
a
écrit:Bonjour.
L'image doit être collée dans le classeur mis en pièce jointe.
Poste ton code modifié.
Daniel
"Excell" a écrit dans le message de news:Bonjour,
apres beeaucoup d'essai, l'image n'apparait jamais.
La je coinces
merci pour l'aide
RP
le client e-mail révolutionnaire d'Opera : http://www.opera.com/mail/
--
Utilisant le client e-mail révolutionnaire d'Opera :
http://www.opera.com/mail/
Oups.
.Pictures.Insert("c:image.jpeg").Select
Daniel
"Excell" a écrit dans le message de news:
j'ai toujours le meme message d'erreur,
désolé
Le Thu, 20 Dec 2007 14:15:31 +0100, Daniel.C a
écrit:Tu insères l'image sur la feuille d'origine, pas sur le classeur que tu
mets
en pièce jointe.
Modifie :
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
End With
en :
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
.Range("L3").Select
.Picture.Insert ("c:image.jpeg")
End With
Modifie le "L3" pour positionner la signature sur la feuille.
Daniel
"Excell" a écrit dans le message de news:voici la nouvelle version du code
Sub Button16_Click()
'Working in 2000-2007
Dim Source As Range
Dim Dest As Workbook
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long
Dim OutApp As Object
Dim OutMail As Object
Set Source = Nothing
On Error Resume Next
Set Source = Range("a1:u44").SpecialCells(xlCellTypeVisible)
Range("L3").Select
ActiveSheet.Picture.Insert ("c:image.jpeg")
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.Picture = picpicture
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
On Error GoTo 0
If Source Is Nothing Then
MsgBox "blabala.....", vbOKOnly
Exit Sub
End If
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
'Set
wb = Sheets("Rapports").Range("c3") 'ActiveWorkbook
Set Dest = Workbooks.Add(xlWBATWorksheet)
Source.Copy
' Range("L3").Select
' ActiveSheet.Picture.Insert ("c:image.jpeg")
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
end With
TempFilePath = Environ$("temp") & ""
TempFileName = "Rapport hebdomadaire de " & wb '.Name & " " &
Format(Now, "dd-mmm-yy h-mm-ss")
If Val(Application.Version) < 12 Then
'You use Excel 2000-2003
FileExtStr = ".xls": FileFormatNum = -4143
End If
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
With Dest
.SaveAs TempFilePath & TempFileName & FileExtStr,
FileFormat:=FileFormatNum
On Error Resume Next
With OutMail
.To = "adressemail"
.cc = ""
.BCC = ""
.Subject = "Rapport hebdomadaire"
.Body = "Bonjour, voici mon rapport hebdomadaire. " & wb
.Attachments.Add Dest.FullName
.Display
End With
On Error GoTo 0
.Close savechanges:úlse
End With
Kill TempFilePath & TempFileName & FileExtStr
Set OutMail = Nothing
Set OutApp = Nothing
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
Là ou j'ai mis les lignes pour l'image(14 eme ligne),ok le document est
envoyé sans l'image
ailleurs(ou en plus des lignes 14 et 15), comme celles mises en
commentaire sur ce code, j'ai une erreur et excell me dit "erreur
d'execution'438':propriete et methode non gérée par cet objet" et le
debogage va sur la ligne
ActiveSheet.Picture.Insert ("c:image.jpeg")
Le Thu, 20 Dec 2007 12:45:19 +0100, Daniel.C a
écrit:Bonjour.
L'image doit être collée dans le classeur mis en pièce jointe.
Poste ton code modifié.
Daniel
"Excell" a écrit dans le message de news:Bonjour,
apres beeaucoup d'essai, l'image n'apparait jamais.
La je coinces
merci pour l'aide
RP
le client e-mail révolutionnaire d'Opera : http://www.opera.com/mail/
--
Utilisant le client e-mail révolutionnaire d'Opera :
http://www.opera.com/mail/
Oups.
.Pictures.Insert("c:image.jpeg").Select
Daniel
"Excell" <test@happymany.net> a écrit dans le message de news:
op.t3m02qtjkiwcv4@romu-b9b4abcecb...
j'ai toujours le meme message d'erreur,
désolé
Le Thu, 20 Dec 2007 14:15:31 +0100, Daniel.C <dZZZcolardelle@free.fr> a
écrit:
Tu insères l'image sur la feuille d'origine, pas sur le classeur que tu
mets
en pièce jointe.
Modifie :
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
End With
en :
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
.Range("L3").Select
.Picture.Insert ("c:image.jpeg")
End With
Modifie le "L3" pour positionner la signature sur la feuille.
Daniel
"Excell" <test@happymany.net> a écrit dans le message de news:
op.t3mwm1bckiwcv4@romu-b9b4abcecb...
voici la nouvelle version du code
Sub Button16_Click()
'Working in 2000-2007
Dim Source As Range
Dim Dest As Workbook
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long
Dim OutApp As Object
Dim OutMail As Object
Set Source = Nothing
On Error Resume Next
Set Source = Range("a1:u44").SpecialCells(xlCellTypeVisible)
Range("L3").Select
ActiveSheet.Picture.Insert ("c:image.jpeg")
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.Picture = picpicture
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
On Error GoTo 0
If Source Is Nothing Then
MsgBox "blabala.....", vbOKOnly
Exit Sub
End If
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
'Set
wb = Sheets("Rapports").Range("c3") 'ActiveWorkbook
Set Dest = Workbooks.Add(xlWBATWorksheet)
Source.Copy
' Range("L3").Select
' ActiveSheet.Picture.Insert ("c:image.jpeg")
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
end With
TempFilePath = Environ$("temp") & ""
TempFileName = "Rapport hebdomadaire de " & wb '.Name & " " &
Format(Now, "dd-mmm-yy h-mm-ss")
If Val(Application.Version) < 12 Then
'You use Excel 2000-2003
FileExtStr = ".xls": FileFormatNum = -4143
End If
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
With Dest
.SaveAs TempFilePath & TempFileName & FileExtStr,
FileFormat:=FileFormatNum
On Error Resume Next
With OutMail
.To = "adressemail"
.cc = ""
.BCC = ""
.Subject = "Rapport hebdomadaire"
.Body = "Bonjour, voici mon rapport hebdomadaire. " & wb
.Attachments.Add Dest.FullName
.Display
End With
On Error GoTo 0
.Close savechanges:úlse
End With
Kill TempFilePath & TempFileName & FileExtStr
Set OutMail = Nothing
Set OutApp = Nothing
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
Là ou j'ai mis les lignes pour l'image(14 eme ligne),ok le document est
envoyé sans l'image
ailleurs(ou en plus des lignes 14 et 15), comme celles mises en
commentaire sur ce code, j'ai une erreur et excell me dit "erreur
d'execution'438':propriete et methode non gérée par cet objet" et le
debogage va sur la ligne
ActiveSheet.Picture.Insert ("c:image.jpeg")
Le Thu, 20 Dec 2007 12:45:19 +0100, Daniel.C <dZZZcolardelle@free.fr> a
écrit:
Bonjour.
L'image doit être collée dans le classeur mis en pièce jointe.
Poste ton code modifié.
Daniel
"Excell" <test@happymany.net> a écrit dans le message de news:
op.t3msp1pnkiwcv4@romu-b9b4abcecb...
Bonjour,
apres beeaucoup d'essai, l'image n'apparait jamais.
La je coinces
merci pour l'aide
RP
le client e-mail révolutionnaire d'Opera : http://www.opera.com/mail/
--
Utilisant le client e-mail révolutionnaire d'Opera :
http://www.opera.com/mail/
Oups.
.Pictures.Insert("c:image.jpeg").Select
Daniel
"Excell" a écrit dans le message de news:
j'ai toujours le meme message d'erreur,
désolé
Le Thu, 20 Dec 2007 14:15:31 +0100, Daniel.C a
écrit:Tu insères l'image sur la feuille d'origine, pas sur le classeur que tu
mets
en pièce jointe.
Modifie :
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
End With
en :
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
.Range("L3").Select
.Picture.Insert ("c:image.jpeg")
End With
Modifie le "L3" pour positionner la signature sur la feuille.
Daniel
"Excell" a écrit dans le message de news:voici la nouvelle version du code
Sub Button16_Click()
'Working in 2000-2007
Dim Source As Range
Dim Dest As Workbook
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long
Dim OutApp As Object
Dim OutMail As Object
Set Source = Nothing
On Error Resume Next
Set Source = Range("a1:u44").SpecialCells(xlCellTypeVisible)
Range("L3").Select
ActiveSheet.Picture.Insert ("c:image.jpeg")
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.Picture = picpicture
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
On Error GoTo 0
If Source Is Nothing Then
MsgBox "blabala.....", vbOKOnly
Exit Sub
End If
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
'Set
wb = Sheets("Rapports").Range("c3") 'ActiveWorkbook
Set Dest = Workbooks.Add(xlWBATWorksheet)
Source.Copy
' Range("L3").Select
' ActiveSheet.Picture.Insert ("c:image.jpeg")
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
end With
TempFilePath = Environ$("temp") & ""
TempFileName = "Rapport hebdomadaire de " & wb '.Name & " " &
Format(Now, "dd-mmm-yy h-mm-ss")
If Val(Application.Version) < 12 Then
'You use Excel 2000-2003
FileExtStr = ".xls": FileFormatNum = -4143
End If
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
With Dest
.SaveAs TempFilePath & TempFileName & FileExtStr,
FileFormat:=FileFormatNum
On Error Resume Next
With OutMail
.To = "adressemail"
.cc = ""
.BCC = ""
.Subject = "Rapport hebdomadaire"
.Body = "Bonjour, voici mon rapport hebdomadaire. " & wb
.Attachments.Add Dest.FullName
.Display
End With
On Error GoTo 0
.Close savechanges:úlse
End With
Kill TempFilePath & TempFileName & FileExtStr
Set OutMail = Nothing
Set OutApp = Nothing
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
Là ou j'ai mis les lignes pour l'image(14 eme ligne),ok le document est
envoyé sans l'image
ailleurs(ou en plus des lignes 14 et 15), comme celles mises en
commentaire sur ce code, j'ai une erreur et excell me dit "erreur
d'execution'438':propriete et methode non gérée par cet objet" et le
debogage va sur la ligne
ActiveSheet.Picture.Insert ("c:image.jpeg")
Le Thu, 20 Dec 2007 12:45:19 +0100, Daniel.C a
écrit:Bonjour.
L'image doit être collée dans le classeur mis en pièce jointe.
Poste ton code modifié.
Daniel
"Excell" a écrit dans le message de news:Bonjour,
apres beeaucoup d'essai, l'image n'apparait jamais.
La je coinces
merci pour l'aide
RP
le client e-mail révolutionnaire d'Opera : http://www.opera.com/mail/
--
Utilisant le client e-mail révolutionnaire d'Opera :
http://www.opera.com/mail/
Je ne suis pas trop à l'aise avec les images. Ce que je t'ai donné, je
l'ai
eu avec l'enregistreur de macros. Tu devrais ouvrir un nouveau fil pour
l'insertion d'image.
Daniel
"Daniel.C" a écrit dans le message de news:Oups.
.Pictures.Insert("c:image.jpeg").Select
Daniel
"Excell" a écrit dans le message de news:
j'ai toujours le meme message d'erreur,
désolé
Le Thu, 20 Dec 2007 14:15:31 +0100, Daniel.C a
écrit:Tu insères l'image sur la feuille d'origine, pas sur le classeur que
tu
mets
en pièce jointe.
Modifie :
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
End With
en :
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
.Range("L3").Select
.Picture.Insert ("c:image.jpeg")
End With
Modifie le "L3" pour positionner la signature sur la feuille.
Daniel
"Excell" a écrit dans le message de news:voici la nouvelle version du code
Sub Button16_Click()
'Working in 2000-2007
Dim Source As Range
Dim Dest As Workbook
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long
Dim OutApp As Object
Dim OutMail As Object
Set Source = Nothing
On Error Resume Next
Set Source = Range("a1:u44").SpecialCells(xlCellTypeVisible)
Range("L3").Select
ActiveSheet.Picture.Insert ("c:image.jpeg")
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.Picture = picpicture
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
On Error GoTo 0
If Source Is Nothing Then
MsgBox "blabala.....", vbOKOnly
Exit Sub
End If
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
'Set
wb = Sheets("Rapports").Range("c3") 'ActiveWorkbook
Set Dest = Workbooks.Add(xlWBATWorksheet)
Source.Copy
' Range("L3").Select
' ActiveSheet.Picture.Insert ("c:image.jpeg")
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
end With
TempFilePath = Environ$("temp") & ""
TempFileName = "Rapport hebdomadaire de " & wb '.Name & " " &
Format(Now, "dd-mmm-yy h-mm-ss")
If Val(Application.Version) < 12 Then
'You use Excel 2000-2003
FileExtStr = ".xls": FileFormatNum = -4143
End If
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
With Dest
.SaveAs TempFilePath & TempFileName & FileExtStr,
FileFormat:=FileFormatNum
On Error Resume Next
With OutMail
.To = "adressemail"
.cc = ""
.BCC = ""
.Subject = "Rapport hebdomadaire"
.Body = "Bonjour, voici mon rapport hebdomadaire. " & wb
.Attachments.Add Dest.FullName
.Display
End With
On Error GoTo 0
.Close savechanges:úlse
End With
Kill TempFilePath & TempFileName & FileExtStr
Set OutMail = Nothing
Set OutApp = Nothing
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
Là ou j'ai mis les lignes pour l'image(14 eme ligne),ok le document
est
envoyé sans l'image
ailleurs(ou en plus des lignes 14 et 15), comme celles mises en
commentaire sur ce code, j'ai une erreur et excell me dit "erreur
d'execution'438':propriete et methode non gérée par cet objet" et le
debogage va sur la ligne
ActiveSheet.Picture.Insert ("c:image.jpeg")
Le Thu, 20 Dec 2007 12:45:19 +0100, Daniel.C
a
écrit:Bonjour.
L'image doit être collée dans le classeur mis en pièce jointe.
Poste ton code modifié.
Daniel
"Excell" a écrit dans le message de news:Bonjour,
apres beeaucoup d'essai, l'image n'apparait jamais.
La je coinces
merci pour l'aide
RP
le client e-mail révolutionnaire d'Opera :
http://www.opera.com/mail/
--
Utilisant le client e-mail révolutionnaire d'Opera :
http://www.opera.com/mail/
Je ne suis pas trop à l'aise avec les images. Ce que je t'ai donné, je
l'ai
eu avec l'enregistreur de macros. Tu devrais ouvrir un nouveau fil pour
l'insertion d'image.
Daniel
"Daniel.C" <dZZZcolardelle@free.fr> a écrit dans le message de news:
uqybdkxQIHA.3676@TK2MSFTNGP06.phx.gbl...
Oups.
.Pictures.Insert("c:image.jpeg").Select
Daniel
"Excell" <test@happymany.net> a écrit dans le message de news:
op.t3m02qtjkiwcv4@romu-b9b4abcecb...
j'ai toujours le meme message d'erreur,
désolé
Le Thu, 20 Dec 2007 14:15:31 +0100, Daniel.C <dZZZcolardelle@free.fr> a
écrit:
Tu insères l'image sur la feuille d'origine, pas sur le classeur que
tu
mets
en pièce jointe.
Modifie :
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
End With
en :
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
.Range("L3").Select
.Picture.Insert ("c:image.jpeg")
End With
Modifie le "L3" pour positionner la signature sur la feuille.
Daniel
"Excell" <test@happymany.net> a écrit dans le message de news:
op.t3mwm1bckiwcv4@romu-b9b4abcecb...
voici la nouvelle version du code
Sub Button16_Click()
'Working in 2000-2007
Dim Source As Range
Dim Dest As Workbook
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long
Dim OutApp As Object
Dim OutMail As Object
Set Source = Nothing
On Error Resume Next
Set Source = Range("a1:u44").SpecialCells(xlCellTypeVisible)
Range("L3").Select
ActiveSheet.Picture.Insert ("c:image.jpeg")
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.Picture = picpicture
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
On Error GoTo 0
If Source Is Nothing Then
MsgBox "blabala.....", vbOKOnly
Exit Sub
End If
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
'Set
wb = Sheets("Rapports").Range("c3") 'ActiveWorkbook
Set Dest = Workbooks.Add(xlWBATWorksheet)
Source.Copy
' Range("L3").Select
' ActiveSheet.Picture.Insert ("c:image.jpeg")
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
end With
TempFilePath = Environ$("temp") & ""
TempFileName = "Rapport hebdomadaire de " & wb '.Name & " " &
Format(Now, "dd-mmm-yy h-mm-ss")
If Val(Application.Version) < 12 Then
'You use Excel 2000-2003
FileExtStr = ".xls": FileFormatNum = -4143
End If
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
With Dest
.SaveAs TempFilePath & TempFileName & FileExtStr,
FileFormat:=FileFormatNum
On Error Resume Next
With OutMail
.To = "adressemail"
.cc = ""
.BCC = ""
.Subject = "Rapport hebdomadaire"
.Body = "Bonjour, voici mon rapport hebdomadaire. " & wb
.Attachments.Add Dest.FullName
.Display
End With
On Error GoTo 0
.Close savechanges:úlse
End With
Kill TempFilePath & TempFileName & FileExtStr
Set OutMail = Nothing
Set OutApp = Nothing
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
Là ou j'ai mis les lignes pour l'image(14 eme ligne),ok le document
est
envoyé sans l'image
ailleurs(ou en plus des lignes 14 et 15), comme celles mises en
commentaire sur ce code, j'ai une erreur et excell me dit "erreur
d'execution'438':propriete et methode non gérée par cet objet" et le
debogage va sur la ligne
ActiveSheet.Picture.Insert ("c:image.jpeg")
Le Thu, 20 Dec 2007 12:45:19 +0100, Daniel.C
<dZZZcolardelle@free.fr> a
écrit:
Bonjour.
L'image doit être collée dans le classeur mis en pièce jointe.
Poste ton code modifié.
Daniel
"Excell" <test@happymany.net> a écrit dans le message de news:
op.t3msp1pnkiwcv4@romu-b9b4abcecb...
Bonjour,
apres beeaucoup d'essai, l'image n'apparait jamais.
La je coinces
merci pour l'aide
RP
le client e-mail révolutionnaire d'Opera :
http://www.opera.com/mail/
--
Utilisant le client e-mail révolutionnaire d'Opera :
http://www.opera.com/mail/
Je ne suis pas trop à l'aise avec les images. Ce que je t'ai donné, je
l'ai
eu avec l'enregistreur de macros. Tu devrais ouvrir un nouveau fil pour
l'insertion d'image.
Daniel
"Daniel.C" a écrit dans le message de news:Oups.
.Pictures.Insert("c:image.jpeg").Select
Daniel
"Excell" a écrit dans le message de news:
j'ai toujours le meme message d'erreur,
désolé
Le Thu, 20 Dec 2007 14:15:31 +0100, Daniel.C a
écrit:Tu insères l'image sur la feuille d'origine, pas sur le classeur que
tu
mets
en pièce jointe.
Modifie :
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
End With
en :
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
.Range("L3").Select
.Picture.Insert ("c:image.jpeg")
End With
Modifie le "L3" pour positionner la signature sur la feuille.
Daniel
"Excell" a écrit dans le message de news:voici la nouvelle version du code
Sub Button16_Click()
'Working in 2000-2007
Dim Source As Range
Dim Dest As Workbook
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long
Dim OutApp As Object
Dim OutMail As Object
Set Source = Nothing
On Error Resume Next
Set Source = Range("a1:u44").SpecialCells(xlCellTypeVisible)
Range("L3").Select
ActiveSheet.Picture.Insert ("c:image.jpeg")
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.Picture = picpicture
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
On Error GoTo 0
If Source Is Nothing Then
MsgBox "blabala.....", vbOKOnly
Exit Sub
End If
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
'Set
wb = Sheets("Rapports").Range("c3") 'ActiveWorkbook
Set Dest = Workbooks.Add(xlWBATWorksheet)
Source.Copy
' Range("L3").Select
' ActiveSheet.Picture.Insert ("c:image.jpeg")
With Dest.Sheets(1)
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.LeftMargin = Application.CentimetersToPoints(0.1)
.RightMargin = Application.CentimetersToPoints(0.1)
.TopMargin = Application.CentimetersToPoints(0.1)
.BottomMargin = Application.CentimetersToPoints(0.1)
End With
For Each c In Source
c.Copy
.Range(c.Address).PasteSpecial xlPasteColumnWidths
.Range(c.Address).PasteSpecial xlPasteValues
.Range(c.Address).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
Next c
end With
TempFilePath = Environ$("temp") & ""
TempFileName = "Rapport hebdomadaire de " & wb '.Name & " " &
Format(Now, "dd-mmm-yy h-mm-ss")
If Val(Application.Version) < 12 Then
'You use Excel 2000-2003
FileExtStr = ".xls": FileFormatNum = -4143
End If
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
With Dest
.SaveAs TempFilePath & TempFileName & FileExtStr,
FileFormat:=FileFormatNum
On Error Resume Next
With OutMail
.To = "adressemail"
.cc = ""
.BCC = ""
.Subject = "Rapport hebdomadaire"
.Body = "Bonjour, voici mon rapport hebdomadaire. " & wb
.Attachments.Add Dest.FullName
.Display
End With
On Error GoTo 0
.Close savechanges:úlse
End With
Kill TempFilePath & TempFileName & FileExtStr
Set OutMail = Nothing
Set OutApp = Nothing
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
Là ou j'ai mis les lignes pour l'image(14 eme ligne),ok le document
est
envoyé sans l'image
ailleurs(ou en plus des lignes 14 et 15), comme celles mises en
commentaire sur ce code, j'ai une erreur et excell me dit "erreur
d'execution'438':propriete et methode non gérée par cet objet" et le
debogage va sur la ligne
ActiveSheet.Picture.Insert ("c:image.jpeg")
Le Thu, 20 Dec 2007 12:45:19 +0100, Daniel.C
a
écrit:Bonjour.
L'image doit être collée dans le classeur mis en pièce jointe.
Poste ton code modifié.
Daniel
"Excell" a écrit dans le message de news:Bonjour,
apres beeaucoup d'essai, l'image n'apparait jamais.
La je coinces
merci pour l'aide
RP
le client e-mail révolutionnaire d'Opera :
http://www.opera.com/mail/
--
Utilisant le client e-mail révolutionnaire d'Opera :
http://www.opera.com/mail/