Excel VBA, sending an excel sheet as an image through email

Grespond

New Member
Joined
Jul 20, 2015
Messages
3
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
 
have you considered exporting it as PDF
 
Upvote 0
yes mole, i found a code which saves as a pdf file :)

however, i was just wondering if there was a way to save it as a image file
 
Upvote 0
PDF is more a display than an usable text file (if you have ever tried to re extract info), which is why it is usable over many different systems

As for exporting in the myriad varieties of images, i'm afraid I don't know
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top