LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Ron on email code

I get an error on the ActiveWorkbook.Sheets("Impulse").Export _
Filename:=Fname, FilterName:="GIF" ... line saying error 438
Sub emailimpulse()
'Working in 2000-2007
Dim OutApp As Object
Dim OutMail As Object
Dim Fname As String

Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)

'fill in the file path/name of the gif file
Fname = "C:\My_impulse.gif"

'Save Chart sheet as Gif file
ActiveWorkbook.Sheets("Impulse").Export _
Filename:=Fname, FilterName:="GIF"

On Error Resume Next
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "Impulse" & " " & Format(Now, "mm-dd-yy h:mm:ss")
.Body = ""
.Attachments.Add Fname
.display 'or use .Display
End With
On Error GoTo 0

Kill Fname
Set OutMail = Nothing
Set OutApp = Nothing
End Sub


CAN you help?
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Email code ozhunter Excel Worksheet Functions 1 May 22nd 09 06:04 AM
VBA code to CC email Mary[_12_] Excel Programming 3 April 1st 07 08:48 PM
Need help with email code (PLEASE) [email protected] Excel Programming 9 October 22nd 06 01:44 AM
Email VBA Code caldog Excel Programming 2 November 23rd 05 02:36 AM
VBA Code for Email DejaVu[_5_] Excel Programming 2 June 3rd 05 02:37 PM


All times are GMT +1. The time now is 01:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"