Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default emailing workbooks

Using Excel 2000 under Win 2K:

I'd like to write code that will send a workbook as an attachment by email.
I haven't been able to find much in the help files. I tried the following
but got a 1004 Run-Time Error 'Application-Defined or Object-Defined Error'

"MyUserName" is the UserID required to log in to my Email server,
"MyPassword" is the password for the same.

Public Sub MailWkbk()
If IsNull(Application.MailSession) Then
Application.MailLogon "MyUserName", "MyPassword", False
End If

ThisWorkbook.SendMail "MyEmailAddress", "Test Send"

Application.MailLogoff

End Sub

Can anyone suggest some code to accomplish this?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default emailing workbooks

Hi
you may have a look at
http://www.rondebruin.nl/sendmail.htm
for more information regarding mailing from Excel

Frank


WIlliam Barnes wrote:
Using Excel 2000 under Win 2K:

I'd like to write code that will send a workbook as an attachment by
email. I haven't been able to find much in the help files. I tried
the following but got a 1004 Run-Time Error 'Application-Defined or
Object-Defined Error'

"MyUserName" is the UserID required to log in to my Email server,
"MyPassword" is the password for the same.

Public Sub MailWkbk()
If IsNull(Application.MailSession) Then
Application.MailLogon "MyUserName", "MyPassword", False
End If

ThisWorkbook.SendMail "MyEmailAddress", "Test Send"

Application.MailLogoff

End Sub

Can anyone suggest some code to accomplish this?



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
Moving / Emailing Macro Workbooks with Custom Toolbars Jon Lam[_2_] Excel Worksheet Functions 2 March 25th 09 05:17 PM
Emailing individual sheets in workbooks on Office 2007 nmolloysukiwt Excel Discussion (Misc queries) 1 September 8th 08 05:36 PM
emailing workbooks Jerry Excel Worksheet Functions 1 September 21st 06 05:48 PM
Emailing momotaro Excel Discussion (Misc queries) 1 March 21st 06 09:12 PM
Links between workbooks and emailing workbook Leslie Excel Worksheet Functions 4 July 1st 05 02:02 PM


All times are GMT +1. The time now is 01:48 PM.

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"