Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Send Attachment (previous one got away)
I'm using a code from the Walkenbach book to send a single sheet from a workbook in an email: Sub SendOneSheet() Dim Filename As String Filename = "my file.xls" ActiveWorkbook.Worksheets("sheet1").Copy To this point everything makes sense to me. Then... ActiveWorkbook.SaveAs Filename <--- How does this step know to save the copied "sheet1" and save that as Filename? ActiveWorkbook.Sendmail ", "My Sheet" <--- Here, what tells it to attach the saved file to the email? ActiveWorkbook.Close False Kill Filename End Sub Got the rest. Another twist I'd like to use would be to copy the "sheet1" and PasteSpecial Values so that all formulas are eliminated, leaving just the result of the formula at the time of the code being run... Thanks for any help. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Send Attachment (previous one got away)
Try copying a sheet from an existing workbook manually. You'll see that the
activesheet becomes the newly copied sheet. Same with the activeworkbook. After the .copy line with activesheet.cells .value = .value end with or with activesheet.cells .copy .pastespecial paste:=xlpastevalues end with MLT wrote: I'm using a code from the Walkenbach book to send a single sheet from a workbook in an email: Sub SendOneSheet() Dim Filename As String Filename = "my file.xls" ActiveWorkbook.Worksheets("sheet1").Copy To this point everything makes sense to me. Then... ActiveWorkbook.SaveAs Filename <--- How does this step know to save the copied "sheet1" and save that as Filename? ActiveWorkbook.Sendmail ", "My Sheet" <--- Here, what tells it to attach the saved file to the email? ActiveWorkbook.Close False Kill Filename End Sub Got the rest. Another twist I'd like to use would be to copy the "sheet1" and PasteSpecial Values so that all formulas are eliminated, leaving just the result of the formula at the time of the code being run... Thanks for any help. -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Send Attachment (previous one got away)
See also
http://www.rondebruin.nl/mail/folder1/mail2.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "MLT" wrote in message ... I'm using a code from the Walkenbach book to send a single sheet from a workbook in an email: Sub SendOneSheet() Dim Filename As String Filename = "my file.xls" ActiveWorkbook.Worksheets("sheet1").Copy To this point everything makes sense to me. Then... ActiveWorkbook.SaveAs Filename <--- How does this step know to save the copied "sheet1" and save that as Filename? ActiveWorkbook.Sendmail ", "My Sheet" <--- Here, what tells it to attach the saved file to the email? ActiveWorkbook.Close False Kill Filename End Sub Got the rest. Another twist I'd like to use would be to copy the "sheet1" and PasteSpecial Values so that all formulas are eliminated, leaving just the result of the formula at the time of the code being run... Thanks for any help. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Send Attachment (previous one got away)
I'm using a script written by Ron Debruin to send an email with an
attachment. I'm not sure its necessary to repost that code here but I'm trying to figure out what part of the code actually sends the email. What I'd like to do is cut the code just short of sending the message so that the user can add text to the body of the message, then send it when ready. Help? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Send Attachment (previous one got away)
Hi MLT
If you use the Outlook object model code from my site you can change .Send to .Display If you use the code from the first section of my mail page the only way is to leave the To string empty Choose a address in the address book of your mail program. When you use "" you can choose a mail address in your address book. .SendMail "", "This is the Subject line" -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "MLT" wrote in message ... I'm using a script written by Ron Debruin to send an email with an attachment. I'm not sure its necessary to repost that code here but I'm trying to figure out what part of the code actually sends the email. What I'd like to do is cut the code just short of sending the message so that the user can add text to the body of the message, then send it when ready. Help? __________ Information from ESET Smart Security, version of virus signature database 3943 (20090317) __________ The message was checked by ESET Smart Security. http://www.eset.com __________ Information from ESET Smart Security, version of virus signature database 3943 (20090317) __________ The message was checked by ESET Smart Security. http://www.eset.com |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Send Attachment (previous one got away)
Duh, it was right there in the commenting. That works perfectly,
thanks! |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Send Attachment (previous one got away)
You are welcome
-- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "MLT" wrote in message ... Duh, it was right there in the commenting. That works perfectly, thanks! __________ Information from ESET Smart Security, version of virus signature database 3943 (20090317) __________ The message was checked by ESET Smart Security. http://www.eset.com __________ Information from ESET Smart Security, version of virus signature database 3943 (20090317) __________ The message was checked by ESET Smart Security. http://www.eset.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Send As PDF Attachment | Excel Discussion (Misc queries) | |||
Help to Send as attachment. | New Users to Excel | |||
Send as Attachment | Excel Discussion (Misc queries) | |||
My send to in excel/word does not offer send as attachment | Excel Discussion (Misc queries) | |||
send as attachment | Excel Discussion (Misc queries) |