Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Macro Problem

Sub SendMail()
Dim objOutlook As Object
Dim objMailItem As Object
Dim objRecipient As Object


Set objOutlook = CreateObject("Outlook.Application")

Set objMailItem = objOutlook.CreateItem(0)
Set objRecipient = objMailItem.Recipients.Add _
(ActiveSheet.Range("B2").Value)


objRecipient.Type = 1 '1 = To, use 2 for cc
objMailItem.Subject = "The extract has finished."

'Instead of the path to the file - I want to insert Active
Workbook in the next line
objMailItem.Attachments.Add _
("C:\Al Jager\! BookTest1.xls")
objMailItem.Display 'change to .Send if you don't
want to interact

End Sub
Reply
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
MACRO PROBLEM ??? JAYC099 Excel Worksheet Functions 2 August 14th 08 12:06 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Worksheet Functions 1 May 3rd 08 02:35 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Discussion (Misc queries) 1 May 3rd 08 10:52 AM
Macro problem tweacle Excel Worksheet Functions 0 February 15th 06 08:26 PM
Run a macro problem? Philip Mariconda Excel Programming 0 September 26th 03 05:10 PM


All times are GMT +1. The time now is 02:59 PM.

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

About Us

"It's about Microsoft Excel"