Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / December 2006

Tip: Looking for answers? Try searching our database.

send excel by email

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sérgio Aires - 12 Dec 2006 10:47 GMT
hi
I'm trying to send a sheet by email, but I want to send just a sheet. I'm
using this code:
ActiveWorkbook.SendMail Recipients:="sergio.aires@tecnovia.pt"

but with this code all file is send.
how can I do for to send just a sheet??

thanks

Signature

Sérgio Aires
Lisboa
Portugal

Madhan - 12 Dec 2006 12:01 GMT
Hi,
A sheet is not a standalone object (otherwise, Microsoft would have
provided objects at operating system level to recognise them). It exists
within the workbook object, hence, you may not be able to send only worksheet
in an e-mail.

> hi
> I'm trying to send a sheet by email, but I want to send just a sheet. I'm
[quoted text clipped - 5 lines]
>
> thanks
Duncan - 12 Dec 2006 12:08 GMT
Application.DisplayAlerts = False
   Dim wb As Workbook
   Dim strdate As String
   strdate = Format(Now, "dd-mm-yy h-mm-ss")
   Application.ScreenUpdating = False
   Sheets("Sheet2").Copy
   Set wb = ActiveWorkbook
   With wb
       .SaveAs "onesheet.xls"
       .ChangeFileAccess xlReadOnly
   End With
Const cdoSendUsingPickup = 1 'Send message using the local SMTP service
pickup directory.
Const cdoSendUsingPort = 2 'Send the message using the network (SMTP
over the network).
Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "A08 Processing Form"
objMessage.From = """Automatic Spreadsheet Submission""
<NotReal@citb.co.uk>"
objMessage.To = "grant.claimforms@citb.co.uk"
objMessage.TextBody = "Please find attached an A08 Processing Form"
objMessage.AddAttachment wb.FullName
'==This section provides the configuration information for the remote
SMTP server.
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")
= 2
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")
= "100.1.120.2"
'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")
= cdoBasic
'Your UserID on the SMTP server
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername")
= ""
'Your password on the SMTP server
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword")
= ""
'Server port (typically 25)
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25
'Use SSL for the connection (False or True)
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl")
= False
'Connection Timeout in seconds (the maximum time CDO will try to
establish a connection to the SMTP server)
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")
= 60
objMessage.Configuration.Fields.Update
'==End remote SMTP server configuration section==
objMessage.Send
wb.Close (False)
Application.DisplayAlerts = True
Application.ScreenUpdating = True

> Hi,
>  A sheet is not a standalone object (otherwise, Microsoft would have
[quoted text clipped - 11 lines]
> >
> > thanks
Ron de Bruin - 12 Dec 2006 15:29 GMT
See this page for a code example
http://www.rondebruin.nl/sendmail.htm

Signature

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm

> hi
> I'm trying to send a sheet by email, but I want to send just a sheet. I'm
[quoted text clipped - 5 lines]
>
> thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.