Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
mariagloria
 
Posts: n/a
Default send filkes as attachment aut.

PLease help me with this. I need to make a macro so I can open 5 excell
files that are store in the same folder and send all of them as attachment in
1 mail automaticaly. I'm sure I there must be a way to do it. Thanks
--
MG
  #2   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Hi

Which mail program do you use?


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



"mariagloria" wrote in message ...
PLease help me with this. I need to make a macro so I can open 5 excell
files that are store in the same folder and send all of them as attachment in
1 mail automaticaly. I'm sure I there must be a way to do it. Thanks
--
MG



  #3   Report Post  
mariagloria
 
Posts: n/a
Default

Microsoft Outlook

"Ron de Bruin" wrote:

Hi

Which mail program do you use?


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



"mariagloria" wrote in message ...
PLease help me with this. I need to make a macro so I can open 5 excell
files that are store in the same folder and send all of them as attachment in
1 mail automaticaly. I'm sure I there must be a way to do it. Thanks
--
MG




  #4   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Hi mariagloria

You don't have to open the 5 files

Try this one
Copy the code in a normal module in a workbook

Sub Mail_workbooks_Outlook()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
.Attachments.Add ("C:\Data\test1.xls")
.Attachments.Add ("C:\Data\test2.xls")
.Attachments.Add ("C:\Data\test3.xls")
.Attachments.Add ("C:\Data\test4.xls")
.Attachments.Add ("C:\Data\test5.xls")
.display 'or use .Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub

More information on this page
http://www.rondebruin.nl/sendmail.htm


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



"mariagloria" wrote in message ...
Microsoft Outlook

"Ron de Bruin" wrote:

Hi

Which mail program do you use?


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



"mariagloria" wrote in message ...
PLease help me with this. I need to make a macro so I can open 5 excell
files that are store in the same folder and send all of them as attachment in
1 mail automaticaly. I'm sure I there must be a way to do it. Thanks
--
MG






  #5   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Change Display to Send if it is working correct for you

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



"Ron de Bruin" wrote in message ...
Hi mariagloria

You don't have to open the 5 files

Try this one
Copy the code in a normal module in a workbook

Sub Mail_workbooks_Outlook()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
.Attachments.Add ("C:\Data\test1.xls")
.Attachments.Add ("C:\Data\test2.xls")
.Attachments.Add ("C:\Data\test3.xls")
.Attachments.Add ("C:\Data\test4.xls")
.Attachments.Add ("C:\Data\test5.xls")
.display 'or use .Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub

More information on this page
http://www.rondebruin.nl/sendmail.htm


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



"mariagloria" wrote in message ...
Microsoft Outlook

"Ron de Bruin" wrote:

Hi

Which mail program do you use?


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



"mariagloria" wrote in message ...
PLease help me with this. I need to make a macro so I can open 5 excell
files that are store in the same folder and send all of them as attachment in
1 mail automaticaly. I'm sure I there must be a way to do it. Thanks
--
MG









  #6   Report Post  
mariagloria
 
Posts: n/a
Default

thank yoou so much for your answer, but sorry I've never made a program in
excell or macro, besides using the wizard,. Can you tell me where do I have
to place the code you sent? Thanks

"Ron de Bruin" wrote:

Hi mariagloria

You don't have to open the 5 files

Try this one
Copy the code in a normal module in a workbook

Sub Mail_workbooks_Outlook()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
.Attachments.Add ("C:\Data\test1.xls")
.Attachments.Add ("C:\Data\test2.xls")
.Attachments.Add ("C:\Data\test3.xls")
.Attachments.Add ("C:\Data\test4.xls")
.Attachments.Add ("C:\Data\test5.xls")
.display 'or use .Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub

More information on this page
http://www.rondebruin.nl/sendmail.htm


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



"mariagloria" wrote in message ...
Microsoft Outlook

"Ron de Bruin" wrote:

Hi

Which mail program do you use?


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



"mariagloria" wrote in message ...
PLease help me with this. I need to make a macro so I can open 5 excell
files that are store in the same folder and send all of them as attachment in
1 mail automaticaly. I'm sure I there must be a way to do it. Thanks
--
MG






  #7   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Can you tell me where do I have to place the code you sent?

Sure

Open a new workbook
Alt-F11
InsertModule from the menu bar
Paste the sub in there
Change the path/filenames and e-mail address in the code
Alt-Q to go back to Excel

If you do Alt-F8 you get a list of your macro's
Select "Mail_workbooks_Outlook" and press Run

Post back if you need more help


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



"mariagloria" wrote in message ...
thank yoou so much for your answer, but sorry I've never made a program in
excell or macro, besides using the wizard,. Can you tell me where do I have
to place the code you sent? Thanks

"Ron de Bruin" wrote:

Hi mariagloria

You don't have to open the 5 files

Try this one
Copy the code in a normal module in a workbook

Sub Mail_workbooks_Outlook()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
.Attachments.Add ("C:\Data\test1.xls")
.Attachments.Add ("C:\Data\test2.xls")
.Attachments.Add ("C:\Data\test3.xls")
.Attachments.Add ("C:\Data\test4.xls")
.Attachments.Add ("C:\Data\test5.xls")
.display 'or use .Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub

More information on this page
http://www.rondebruin.nl/sendmail.htm


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



"mariagloria" wrote in message ...
Microsoft Outlook

"Ron de Bruin" wrote:

Hi

Which mail program do you use?


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



"mariagloria" wrote in message ...
PLease help me with this. I need to make a macro so I can open 5 excell
files that are store in the same folder and send all of them as attachment in
1 mail automaticaly. I'm sure I there must be a way to do it. Thanks
--
MG








  #8   Report Post  
mariagloria
 
Posts: n/a
Default

Thank you so much, you are great, you don't know how much I needed. I place
it in a module in Access and it worked, that is where ia need inside a menu.
Thank again, by

"Ron de Bruin" wrote:

Can you tell me where do I have to place the code you sent?


Sure

Open a new workbook
Alt-F11
InsertModule from the menu bar
Paste the sub in there
Change the path/filenames and e-mail address in the code
Alt-Q to go back to Excel

If you do Alt-F8 you get a list of your macro's
Select "Mail_workbooks_Outlook" and press Run

Post back if you need more help


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



"mariagloria" wrote in message ...
thank yoou so much for your answer, but sorry I've never made a program in
excell or macro, besides using the wizard,. Can you tell me where do I have
to place the code you sent? Thanks

"Ron de Bruin" wrote:

Hi mariagloria

You don't have to open the 5 files

Try this one
Copy the code in a normal module in a workbook

Sub Mail_workbooks_Outlook()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
.Attachments.Add ("C:\Data\test1.xls")
.Attachments.Add ("C:\Data\test2.xls")
.Attachments.Add ("C:\Data\test3.xls")
.Attachments.Add ("C:\Data\test4.xls")
.Attachments.Add ("C:\Data\test5.xls")
.display 'or use .Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub

More information on this page
http://www.rondebruin.nl/sendmail.htm


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



"mariagloria" wrote in message ...
Microsoft Outlook

"Ron de Bruin" wrote:

Hi

Which mail program do you use?


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



"mariagloria" wrote in message ...
PLease help me with this. I need to make a macro so I can open 5 excell
files that are store in the same folder and send all of them as attachment in
1 mail automaticaly. I'm sure I there must be a way to do it. Thanks
--
MG









  #9   Report Post  
mariagloria
 
Posts: n/a
Default

sorry but I miss something, I need to send all the context of the folder
something like "z:\transmission\*.*" but it doesn´t work like this, do I
always have to write file by file?

"Ron de Bruin" wrote:

Can you tell me where do I have to place the code you sent?


Sure

Open a new workbook
Alt-F11
InsertModule from the menu bar
Paste the sub in there
Change the path/filenames and e-mail address in the code
Alt-Q to go back to Excel

If you do Alt-F8 you get a list of your macro's
Select "Mail_workbooks_Outlook" and press Run

Post back if you need more help


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



"mariagloria" wrote in message ...
thank yoou so much for your answer, but sorry I've never made a program in
excell or macro, besides using the wizard,. Can you tell me where do I have
to place the code you sent? Thanks

"Ron de Bruin" wrote:

Hi mariagloria

You don't have to open the 5 files

Try this one
Copy the code in a normal module in a workbook

Sub Mail_workbooks_Outlook()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
.Attachments.Add ("C:\Data\test1.xls")
.Attachments.Add ("C:\Data\test2.xls")
.Attachments.Add ("C:\Data\test3.xls")
.Attachments.Add ("C:\Data\test4.xls")
.Attachments.Add ("C:\Data\test5.xls")
.display 'or use .Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub

More information on this page
http://www.rondebruin.nl/sendmail.htm


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



"mariagloria" wrote in message ...
Microsoft Outlook

"Ron de Bruin" wrote:

Hi

Which mail program do you use?


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



"mariagloria" wrote in message ...
PLease help me with this. I need to make a macro so I can open 5 excell
files that are store in the same folder and send all of them as attachment in
1 mail automaticaly. I'm sure I there must be a way to do it. Thanks
--
MG









  #10   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Try this for the files in C:\Data

Sub Mail_workbooks_Outlook()
Dim FNames As String
Dim MyPath As String
Dim SaveDriveDir As String
Dim OutApp As Object
Dim OutMail As Object

SaveDriveDir = CurDir
MyPath = "C:\Data" '<----- Change this path
ChDrive MyPath
ChDir MyPath

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"

FNames = Dir("*.xls")
Do While FNames < ""
.Attachments.Add MyPath & "\" & FNames
FNames = Dir()
Loop

.display 'or use .Send
End With

Set OutMail = Nothing
Set OutApp = Nothing
ChDrive SaveDriveDir
ChDir SaveDriveDir

End Sub



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



"mariagloria" wrote in message ...
sorry but I miss something, I need to send all the context of the folder
something like "z:\transmission\*.*" but it doesn´t work like this, do I
always have to write file by file?

"Ron de Bruin" wrote:

Can you tell me where do I have to place the code you sent?


Sure

Open a new workbook
Alt-F11
InsertModule from the menu bar
Paste the sub in there
Change the path/filenames and e-mail address in the code
Alt-Q to go back to Excel

If you do Alt-F8 you get a list of your macro's
Select "Mail_workbooks_Outlook" and press Run

Post back if you need more help


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



"mariagloria" wrote in message ...
thank yoou so much for your answer, but sorry I've never made a program in
excell or macro, besides using the wizard,. Can you tell me where do I have
to place the code you sent? Thanks

"Ron de Bruin" wrote:

Hi mariagloria

You don't have to open the 5 files

Try this one
Copy the code in a normal module in a workbook

Sub Mail_workbooks_Outlook()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
.Attachments.Add ("C:\Data\test1.xls")
.Attachments.Add ("C:\Data\test2.xls")
.Attachments.Add ("C:\Data\test3.xls")
.Attachments.Add ("C:\Data\test4.xls")
.Attachments.Add ("C:\Data\test5.xls")
.display 'or use .Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub

More information on this page
http://www.rondebruin.nl/sendmail.htm


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



"mariagloria" wrote in message ...
Microsoft Outlook

"Ron de Bruin" wrote:

Hi

Which mail program do you use?


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



"mariagloria" wrote in message ...
PLease help me with this. I need to make a macro so I can open 5 excell
files that are store in the same folder and send all of them as attachment in
1 mail automaticaly. I'm sure I there must be a way to do it. Thanks
--
MG











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
Excel should not delete document after trying to send email 4rs Excel Discussion (Misc queries) 0 January 14th 05 04:39 AM
Cannot "Send to -> mail recipient (as attachment)" Jack Excel Discussion (Misc queries) 2 December 18th 04 12:04 PM
Excel Send To Options webeustoo Excel Discussion (Misc queries) 1 December 10th 04 03:39 PM
Excel Send To function problem kysiow Excel Discussion (Misc queries) 1 December 10th 04 01:37 AM
Excel Spreadsheet as an E-mail attachment Margie Excel Discussion (Misc queries) 2 December 9th 04 01:27 PM


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