MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old May 6th, 2002, 08:05 AM   #1
Bob T
New Member
 
Join Date: May 2002
Posts: 17
Default

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"
Bob T is offline   Reply With Quote
Old May 6th, 2002, 08:18 AM   #2
dk
MrExcel MVP
 
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 2,908
Default

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
dk is offline   Reply With Quote
Old May 6th, 2002, 08:20 AM   #3
kkknie
Board Regular
 
Join Date: Apr 2002
Location: Greenwood, SC
Posts: 677
Default

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
kkknie is offline   Reply With Quote
Old May 6th, 2002, 09:02 AM   #4
gareth
Board Regular
 
Join Date: Apr 2002
Location: Cape Town,South Africa
Posts: 234
Default

Hi there friend

maybe you should try this code

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.

__________________
Regards
Gareth
Visit The Excel Maniacs :<>: Have a Chat! :<>: Free Stuff!
gareth is offline   Reply With Quote
Old May 6th, 2002, 01:34 PM   #5
Brian
Board Regular
 
Join Date: Apr 2002
Posts: 113
Default

More e-mail info:

http://www.mrexcel.com/board/viewtop...c=7311&forum=2
Brian is offline   Reply With Quote
Old May 14th, 2002, 01:15 AM   #6
Goofydisney
New Member
 
Join Date: Apr 2002
Posts: 8
Default

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


Goofydisney is offline   Reply With Quote
Old May 14th, 2002, 01:59 AM   #7
Ivan F Moala
MrExcel MVP
 
Ivan F Moala's Avatar
 
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
Default

Quote:
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,
Ivan F Moala
Have a Nice day

[ This Message was edited by: Ivan F Moala on 2002-05-14 01:36 ]
Ivan F Moala is offline   Reply With Quote
Old May 14th, 2002, 02:05 AM   #8
dk
MrExcel MVP
 
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 2,908
Default

Quote:
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
dk is offline   Reply With Quote
Old May 14th, 2002, 02:39 AM   #9
Ivan F Moala
MrExcel MVP
 
Ivan F Moala's Avatar
 
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
Default

Quote:
On 2002-05-14 01:05, dk wrote:
Quote:
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...
__________________
Kind Regards,
Ivan F Moala From the City of Sails
Ivan F Moala is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 01:24 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes