Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sending a Spreadsheet as an Email Attachment vs. Imbedded in Email | Excel Discussion (Misc queries) | |||
Email Attachment | Excel Discussion (Misc queries) | |||
send wkbk as an email attachment with an email address copied from | Excel Discussion (Misc queries) | |||
email as attachment | Excel Discussion (Misc queries) | |||
email as attachment | New Users to Excel |