Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there any way to create a macro which will mail
particular worksheets to users without the whole workbook? For example, I have 15 worksheets in my workbook, each sheet relates to a specific person, and I only want them to see their corresponding sheet? I can email a workbook using the code below, but that's it (my VBA skills are non existent!) Any help appreciated Sub test() Dim objOut As Outlook.Application Dim objMess As Outlook.MailItem Set objOut = CreateObject("Outlook.Application") Set objMess = objOut.CreateItem(olMailItem) strto = " strsub = "test " strbody = "Hi there" With objMess ..To = strto ..Subject = strsub ..Body = strbody ..Display ..Attachments.Add ThisWorkbook.FullName ..Send End With End Sub Stuart |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Stuart
See my webpage for example code http://www.rondebruin.nl/sendmail.htm I think you like this one http://www.rondebruin.nl/sendmail.htm#every -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "stuart" wrote in message ... Is there any way to create a macro which will mail particular worksheets to users without the whole workbook? For example, I have 15 worksheets in my workbook, each sheet relates to a specific person, and I only want them to see their corresponding sheet? I can email a workbook using the code below, but that's it (my VBA skills are non existent!) Any help appreciated Sub test() Dim objOut As Outlook.Application Dim objMess As Outlook.MailItem Set objOut = CreateObject("Outlook.Application") Set objMess = objOut.CreateItem(olMailItem) strto = " strsub = "test " strbody = "Hi there" With objMess .To = strto .Subject = strsub .Body = strbody .Display .Attachments.Add ThisWorkbook.FullName .Send End With End Sub Stuart |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
for each sh in Thisworkbook.worksheets
sh.copy sName = thisworkbook.Path & "\" & sh.name & ".xls" ActiveWorkbook.SaveAs sName ActiveWorkbook.Close SaveChanges:=False ' no send workbook sName ' .Attachments.Add sName Kill sName Next Regards, Tom Ogilvy "stuart" wrote in message ... Is there any way to create a macro which will mail particular worksheets to users without the whole workbook? For example, I have 15 worksheets in my workbook, each sheet relates to a specific person, and I only want them to see their corresponding sheet? I can email a workbook using the code below, but that's it (my VBA skills are non existent!) Any help appreciated Sub test() Dim objOut As Outlook.Application Dim objMess As Outlook.MailItem Set objOut = CreateObject("Outlook.Application") Set objMess = objOut.CreateItem(olMailItem) strto = " strsub = "test " strbody = "Hi there" With objMess .To = strto .Subject = strsub .Body = strbody .Display .Attachments.Add ThisWorkbook.FullName .Send End With End Sub Stuart |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for all your help - the website was particularly
useful. Stuart -----Original Message----- Hi Stuart See my webpage for example code http://www.rondebruin.nl/sendmail.htm I think you like this one http://www.rondebruin.nl/sendmail.htm#every -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "stuart" wrote in message ... Is there any way to create a macro which will mail particular worksheets to users without the whole workbook? For example, I have 15 worksheets in my workbook, each sheet relates to a specific person, and I only want them to see their corresponding sheet? I can email a workbook using the code below, but that's it (my VBA skills are non existent!) Any help appreciated Sub test() Dim objOut As Outlook.Application Dim objMess As Outlook.MailItem Set objOut = CreateObject("Outlook.Application") Set objMess = objOut.CreateItem(olMailItem) strto = " strsub = "test " strbody = "Hi there" With objMess .To = strto .Subject = strsub .Body = strbody .Display .Attachments.Add ThisWorkbook.FullName .Send End With End Sub Stuart . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You are welcome
-- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "stuart" wrote in message ... Thanks for all your help - the website was particularly useful. Stuart -----Original Message----- Hi Stuart See my webpage for example code http://www.rondebruin.nl/sendmail.htm I think you like this one http://www.rondebruin.nl/sendmail.htm#every -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "stuart" wrote in message ... Is there any way to create a macro which will mail particular worksheets to users without the whole workbook? For example, I have 15 worksheets in my workbook, each sheet relates to a specific person, and I only want them to see their corresponding sheet? I can email a workbook using the code below, but that's it (my VBA skills are non existent!) Any help appreciated Sub test() Dim objOut As Outlook.Application Dim objMess As Outlook.MailItem Set objOut = CreateObject("Outlook.Application") Set objMess = objOut.CreateItem(olMailItem) strto = " strsub = "test " strbody = "Hi there" With objMess .To = strto .Subject = strsub .Body = strbody .Display .Attachments.Add ThisWorkbook.FullName .Send End With End Sub Stuart . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
mail merge multiple lines in an e-mail | Excel Discussion (Misc queries) | |||
HOW DO I E-MAIL WORKSHEET AS IS WITH ALL FORMULAS, ETC? | Excel Discussion (Misc queries) | |||
e-mail one worksheet as an attachment | Excel Discussion (Misc queries) | |||
How to E-mail one Worksheet only | Excel Discussion (Misc queries) | |||
E-mail a worksheet | Excel Worksheet Functions |