Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default email as attachment in code

Hi, all!
I have a program that inserts data into excel worksheet.
Now I want to email it. I need your help to find the code equivalent of
manually select menu File/SendTo/Mail Recipient(As Attachment), then type in
a recipient address and send.
I have this line of code:
Call ", "ACD", "")
I got runtime error 1004. Method 'SendMail' of object '_workbook' failed.
I am not sure I am using the right object. I have app, workbook and
worksheet, and I used workbook to save it.
Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default email as attachment in code

sendmail is a method of the workbook, so it appears you are using the correct
object if xlworkbook is a reference to the workbook you want to send


try changing the last argument to False

Call ", "ACD", False)

or omitting it

Call ", "ACD")

--
Regards,
Tom Ogilvy



"hommer" wrote:

Hi, all!
I have a program that inserts data into excel worksheet.
Now I want to email it. I need your help to find the code equivalent of
manually select menu File/SendTo/Mail Recipient(As Attachment), then type in
a recipient address and send.
I have this line of code:
Call ", "ACD", "")
I got runtime error 1004. Method 'SendMail' of object '_workbook' failed.
I am not sure I am using the right object. I have app, workbook and
worksheet, and I used workbook to save it.
Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default email as attachment in code

Great! Tom, it works! Thanks!

"Tom Ogilvy" wrote:

sendmail is a method of the workbook, so it appears you are using the correct
object if xlworkbook is a reference to the workbook you want to send


try changing the last argument to False

Call ", "ACD", False)

or omitting it

Call ", "ACD")

--
Regards,
Tom Ogilvy



"hommer" wrote:

Hi, all!
I have a program that inserts data into excel worksheet.
Now I want to email it. I need your help to find the code equivalent of
manually select menu File/SendTo/Mail Recipient(As Attachment), then type in
a recipient address and send.
I have this line of code:
Call ", "ACD", "")
I got runtime error 1004. Method 'SendMail' of object '_workbook' failed.
I am not sure I am using the right object. I have app, workbook and
worksheet, and I used workbook to save it.
Thanks!

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
Sending a Spreadsheet as an Email Attachment vs. Imbedded in Email billbrandi Excel Discussion (Misc queries) 1 April 3rd 08 03:44 AM
Email Attachment Dan DeCoursey Excel Discussion (Misc queries) 2 August 7th 07 03:00 PM
send wkbk as an email attachment with an email address copied from SueInAtl Excel Discussion (Misc queries) 0 May 21st 07 10:53 PM
email as attachment swimbugs Excel Discussion (Misc queries) 1 March 28th 07 02:14 AM
email as attachment k1 New Users to Excel 3 March 19th 07 06:43 PM


All times are GMT +1. The time now is 07:06 AM.

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"