Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Sending e mail with attachment from button click

Hi,

I have never used macros before..but i have created a button on excel
sheet...a CommandButton1 . Now when this button is clicked a blank e - mail
should open up with this spreadsheet attached to it...

Is there any way this is possible? What code is required for this?

Thanks

--
pmud
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Sending e mail with attachment from button click

Hi Pmud

Look at my site for code examples
http://www.rondebruin.nl/sendmail.htm

Maybe one of the Add-ins is the best choice for you
http://www.rondebruin.nl/mail/add-in.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl



"pmud" wrote in message ...
Hi,

I have never used macros before..but i have created a button on excel
sheet...a CommandButton1 . Now when this button is clicked a blank e - mail
should open up with this spreadsheet attached to it...

Is there any way this is possible? What code is required for this?

Thanks

--
pmud



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Sending e mail with attachment from button click

This code works for me:
Sub Mailit()
Dim BkName As String
ActiveWorkbook.Save
BkName = ActiveWorkbook.FullName
Dim Mailit As Object
Set Mailit = CreateObject("Outlook.Application")
Set NewMail = Mailit.CreateItem(olMailItem)
NewMail.Subject = ActiveWorkbook.Name
NewMail.Attachments.Add BkName
NewMail.Display
End Sub

Attach it to your button. If you want it available for any workbook, put the
module in your personal workbook. Also, be sure the reference to Microsoft
Visual Basic for Applications Extensibility (etc.) is checked under
Tools/Refereces in the VBE



"pmud" wrote in message ...
Hi,

I have never used macros before..but i have created a button on excel
sheet...a CommandButton1 . Now when this button is clicked a blank e - mail
should open up with this spreadsheet attached to it...

Is there any way this is possible? What code is required for this?

Thanks

--
pmud




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Sending e mail with attachment from button click

On second thought , I had forgotten that Excel already provides w way to do
this without programming. Just Click File/Send To/ Mail Recipient(as
Attachment)

"Bob H" wrote:

This code works for me:
Sub Mailit()
Dim BkName As String
ActiveWorkbook.Save
BkName = ActiveWorkbook.FullName
Dim Mailit As Object
Set Mailit = CreateObject("Outlook.Application")
Set NewMail = Mailit.CreateItem(olMailItem)
NewMail.Subject = ActiveWorkbook.Name
NewMail.Attachments.Add BkName
NewMail.Display
End Sub

Attach it to your button. If you want it available for any workbook, put the
module in your personal workbook. Also, be sure the reference to Microsoft
Visual Basic for Applications Extensibility (etc.) is checked under
Tools/Refereces in the VBE



"pmud" wrote in message ...
Hi,

I have never used macros before..but i have created a button on excel
sheet...a CommandButton1 . Now when this button is clicked a blank e - mail
should open up with this spreadsheet attached to it...

Is there any way this is possible? What code is required for this?

Thanks

--
pmud




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Sending e mail with attachment from button click

Hi Ron,

Thanks . that worked..

Cheers

"Ron de Bruin" wrote:

Hi Pmud

Look at my site for code examples
http://www.rondebruin.nl/sendmail.htm

Maybe one of the Add-ins is the best choice for you
http://www.rondebruin.nl/mail/add-in.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl



"pmud" wrote in message ...
Hi,

I have never used macros before..but i have created a button on excel
sheet...a CommandButton1 . Now when this button is clicked a blank e - mail
should open up with this spreadsheet attached to it...

Is there any way this is possible? What code is required for this?

Thanks

--
pmud




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 an excel attachment in an e-mail drumane Excel Discussion (Misc queries) 2 April 21st 08 04:14 PM
send to mail recipient as attachment not sending [email protected] Excel Discussion (Misc queries) 6 May 4th 07 08:42 PM
Sending e-mail with Lotus Notes pressing an excel button AndyOne Excel Discussion (Misc queries) 0 June 1st 05 09:29 PM
Sending Excel file as attachment to Lotus Notes mail Simon Lenn Excel Programming 2 December 9th 03 07:47 PM
Creating mail message with a button click Ray Proudfoot Excel Programming 8 October 2nd 03 08:36 PM


All times are GMT +1. The time now is 06:04 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"