Hi,
I'm using Excel 2013, Windows 8.1
I want to send just the excel sheet containing dashboards (many charts).
Additionally, this excel sheet has to be saved as an image file such as JPG, since the recipients will be receiving the sent file through their phones.
Also, is there a code for sending this said image file to viber?
--------------------------------------------------------------------------------------------------------------------
I tried using the code of Ron de Bruin (Mail chart or chart sheet as picture) - Example 2
I have modified it a bit, but I keep getting the error: "Object doesn't support this property or method" on the line below
ActiveWorkbook.Sheets("Dashboard").Export _
Filename:=Fname, FilterName:="JPG"
-------------------------------------------------------------------------------------------------------------------
Below is my edited code:
Sub SaveSend_Chart_Sheet()
'Working in 2000-2013
'For Tips see: http://www.rondebruin.nl/win/winmail/Outlook/tips.htm
Dim OutApp As Object
Dim OutMail As Object
Dim Fname As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
'File path/name of the gif file
Fname = Environ$("temp") & "\Updates.jpg"
'Save Chart sheet named "Chart1" as gif file
ActiveWorkbook.Sheets("Dashboard").Export _
Filename:=Fname, FilterName:="JPG"
On Error Resume Next
With OutMail
.To = "gerardtco@gmail.com"
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
.Attachments.Add Fname
.Send 'or use .Display
End With
On Error GoTo 0
'Delete the gif file
Kill Fname
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
I'm using Excel 2013, Windows 8.1
I want to send just the excel sheet containing dashboards (many charts).
Additionally, this excel sheet has to be saved as an image file such as JPG, since the recipients will be receiving the sent file through their phones.
Also, is there a code for sending this said image file to viber?
--------------------------------------------------------------------------------------------------------------------
I tried using the code of Ron de Bruin (Mail chart or chart sheet as picture) - Example 2
I have modified it a bit, but I keep getting the error: "Object doesn't support this property or method" on the line below
ActiveWorkbook.Sheets("Dashboard").Export _
Filename:=Fname, FilterName:="JPG"
-------------------------------------------------------------------------------------------------------------------
Below is my edited code:
Sub SaveSend_Chart_Sheet()
'Working in 2000-2013
'For Tips see: http://www.rondebruin.nl/win/winmail/Outlook/tips.htm
Dim OutApp As Object
Dim OutMail As Object
Dim Fname As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
'File path/name of the gif file
Fname = Environ$("temp") & "\Updates.jpg"
'Save Chart sheet named "Chart1" as gif file
ActiveWorkbook.Sheets("Dashboard").Export _
Filename:=Fname, FilterName:="JPG"
On Error Resume Next
With OutMail
.To = "gerardtco@gmail.com"
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
.Attachments.Add Fname
.Send 'or use .Display
End With
On Error GoTo 0
'Delete the gif file
Kill Fname
Set OutMail = Nothing
Set OutApp = Nothing
End Sub