Sending sheet via e-mail

Bob T

New Member
Joined
May 3, 2002
Messages
17
I’m using Excel 2000 and would like to sent one sheet only. I found this code (for Excel 2002) when searching but I get an error message on the 3rd line. This is exactly what I need. Can you help this novice? Thanks.

sheets("sheet1").copy
activeworkbook.sendmail
recipients:="email_address@hotmail.com", Subject:="Testing"
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi Bob,

This code will work fine in Excel 2000 but you need to include the Recipients:= bit on the same line as the ActiveWorkbook.SendMail i.e.

Sheets("sheet1").Copy
ActiveWorkbook.SendMail Recipients:="email_address@hotmail.com", Subject:="Testing"

Recipients and Subject are arguments of the SendMail method.

HTH,
Dan
 
Upvote 0
I copied the code and got it to work. I do know that the 3rd line should be a continuation of the 2nd line (i.e. there should be no 3rd line). Not sure if this is how you intended to post it, or if is just a function of this message board system.

K
 
Upvote 0
Hi there friend :)

maybe you should try this code :cool:

Sub anothermailAP()

Dim filenam As String
Dim ol As Object
Dim mailitem As Object
Dim Subj As String
Dim Month As String
filenam = Application.ActiveWorkbook.FullName
Set ol = CreateObject("Outlook.Application")
Set mailitem = ol.CreateItem(olMailItem)

' Gets the name of the e-mail recipient.
Recip = ""

' Creates the subject line.
Month = Cells(5, 2)
Subj = Month & ""

' Creates the e-mail message text.
messg = "Attached are the worksheet you requested for " & Month & "." & vbCrLf & vbCrLf & _
"Please review them and let me know about any changes that are made."

' Sets all items in the e-mail.
With mailitem
.To = Recip
.Subject = Subj
.Body = messg
.Attachments.Add filenam
.Display
End With

End Sub

Try This,,it send a whole worksheet away to recipient.
 
Upvote 0
Can I send it to Outlook Express instead of Outlook? What do I change in " createobject("Outlook.Application") " ?

I was looking for the Outlook Express Object Model in MSDN but no luck. Anybody know where I can find it?

Thanks
 
Upvote 0
On 2002-05-14 00:15, Goofydisney wrote:
Can I send it to Outlook Express instead of Outlook? What do I change in " createobject("Outlook.Application") " ?

I was looking for the Outlook Express Object Model in MSDN but no luck. Anybody know where I can find it?

The OE object Model is not well supported
In fact I don't beleive the Coms is exposed
for manipulation.

Is OE your default emailer ??
If not then try resetting your default
mail prg in Internet setup to OE.
Thanks





_________________
Kind Regards,<font size=+2><font color="red"> I<font color="blue">van<font color="red"> F M</font color="blue">oala</font><MARQUEE>Have a Nice day
sun.gif
</MARQUEE>
This message was edited by Ivan F Moala on 2002-05-14 01:36
 
Upvote 0
Can I send it to Outlook Express instead of Outlook? What do I change in " createobject("Outlook.Application") " ?

I was looking for the Outlook Express Object Model in MSDN but no luck. Anybody know where I can find it?

Thanks

Hi,

Unfortunately Outlook Express is not an automation server and as such doesn't expose an object model. You won't be able to use code for OE in the same way you can for Outlook. There are samples around for automatically sending mail from OE but I don't think they're as reliable or as neat as code you can create with Outlook - e.g. I think they all rely on the Sendkeys method to actually send the message.

Regards,
Dan
 
Upvote 0
On 2002-05-14 01:05, dk wrote:
Can I send it to Outlook Express instead of Outlook? What do I change in " createobject("Outlook.Application") " ?

I was looking for the Outlook Express Object Model in MSDN but no luck. Anybody know where I can find it?

Thanks

Hi,

Unfortunately Outlook Express is not an automation server and as such doesn't expose an object model. You won't be able to use code for OE in the same way you can for Outlook. There are samples around for automatically sending mail from OE but I don't think they're as reliable or as neat as code you can create with Outlook - e.g. I think they all rely on the Sendkeys method to actually send the message.

Regards,
Dan

I think your right Dan...most if not All rely
on some sought of Send Keys...
 
Upvote 0

Forum statistics

Threads
1,213,530
Messages
6,114,162
Members
448,554
Latest member
Gleisner2

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