Excel:Enviar Rango De Datos Como Imagen En Email
Mando link con ejemplo.Saludos.
CODIGO CORREGIDO. AHORA FUNCIONA OK.!!
Sub Info()
'cuando el mensaje se muestra pareciera que no muestra las imágenes, pero luego las muestra bien.
'When the message is displayedit will look like
'its not embedded correctly, but when Outlook sends the
'message it will embedd it and link the proper source cid.
'
' Must set a reference to Microsoft Outlook ## ObjectLibrary to use this:
'
Dim wks As Worksheet
Dim chtObj As ChartObject
Dim imgobj As Shape
Dim rng As Range
Dim OutApp As Object
Dim OutMail As ObjectDim TempFile As String
Crea_Chart
' Email section
' Email section
Set wks = Sheets("Graph")
TempFile = Environ$("temp") & "/" & Format(Now, "dd-mm-yyh-mm-ss") & ".htm"
If wks.ChartObjects.Count > 0 Then
For Each chtObj In wks.ChartObjects
imgfile = Left(TempFile, Len(TempFile) - 4) & chtObj.ZOrder & ".png"nombre1 = Format(Now, "dd-mm-yy h-mm-ss") & chtObj.ZOrder & ".png"
chtObj.Chart.Export Filename:=imgfile, FilterName:="png"
Next chtObj
End If
'create new Outlook MailItemSet oApp = CreateObject("Outlook.Application")
Set oEmail = oApp.CreateItem(olMailItem)
oEmail.To = ""
Rem imgfile = "c:\tmp.jpg"
'add graphic as attachment to Outlook message'change path to graphic as needed
'change the src property to 'cid:your picture filename'
'it will be changed to the correct cid when its sent.
' oEmail.HTMLBody = "" &...
Regístrate para leer el documento completo.