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

I have 300 reports I create every month, from 3 seperate spreadsheets. I
have created macros with help from this discussion group to automate most of
it. The last step I have is emailing them to my contacts. Is there a way to
use a macro to do this? I can have the email address in the files if needed.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Emailing Files

There are a few ways Lori

You can use code like this
http://www.rondebruin.nl/mail/folder2/files.htm


Or if you filter records in a table you can use something like this
http://www.rondebruin.nl/mail/folder3/row2.htm

If you have a different situation paste back


--

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


"LoriH" wrote in message ...
I have 300 reports I create every month, from 3 seperate spreadsheets. I
have created macros with help from this discussion group to automate most of
it. The last step I have is emailing them to my contacts. Is there a way to
use a macro to do this? I can have the email address in the files if needed.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Emailing Files

I used Ron's links to do this very same thing and it works like a charm! I'm
sure there is a way to use values in a cell to determine who the message gets
sent to.

Dim SendEmail As String
SendEmail = Worksheets("Run Report").Cells(2, 22)
If SendEmail = 1 Then GoTo Line2012:


Dim TradeShowCopies As Integer
TradeShowCopies = Worksheets("TradeShow Copies").Cells(10, 2)
If TradeShowCopies = 0 Then GoTo Line1012:

Dim rng As Range
Dim iMsg As Object
Dim iConf As Object
Dim Flds As Variant

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")

iConf.Load -1 ' CDO Source Defaults
Set Flds = iConf.Fields
With Flds

..Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

..Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"mail.mail.int"

..Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With


Set rng = Nothing
On Error Resume Next

Set rng = Sheets("TradeShow
Copies").Range("a1:j8").SpecialCells(xlCellTypeVis ible)

On Error GoTo 0

If rng Is Nothing Then
MsgBox "The selection is not a range or the sheet is protected" & _
vbNewLine & "please correct and try again.", vbOKOnly
Exit Sub
End If

With Application
.EnableEvents = False
.ScreenUpdating = False
End With

With iMsg
Set .Configuration = iConf
.To = "username"
.From = "username"
.Subject = "Subject here"
.HTMLBody = RangetoHTML(rng)
.Send
End With

With Application
.EnableEvents = True
.ScreenUpdating = True
End With

Line1012:

Don
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Emailing Files

Hi Ron,

Thank you so much the first one is perfect for what I am doing.

Thanks again!!

"Ron de Bruin" wrote:

There are a few ways Lori

You can use code like this
http://www.rondebruin.nl/mail/folder2/files.htm


Or if you filter records in a table you can use something like this
http://www.rondebruin.nl/mail/folder3/row2.htm

If you have a different situation paste back


--

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


"LoriH" wrote in message ...
I have 300 reports I create every month, from 3 seperate spreadsheets. I
have created macros with help from this discussion group to automate most of
it. The last step I have is emailing them to my contacts. Is there a way to
use a macro to do this? I can have the email address in the files if needed.


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
emailing files from excel, the files will not go until I open up . joe New Users to Excel 2 September 18th 09 02:12 PM
Emailing Linked Excel Files SandyH Excel Discussion (Misc queries) 0 July 14th 09 03:20 PM
emailing excel files jayare Excel Discussion (Misc queries) 0 March 30th 06 12:46 PM
Emailing files changes formatting Kim Excel Discussion (Misc queries) 1 June 7th 05 10:07 PM
Emailing files using a do until a Excel Programming 6 February 19th 05 04:33 PM


All times are GMT +1. The time now is 07:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"