Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Mail to multiple receipients

I have a macro that is to automatically send the
worksheet to a particular email address.

At the end of a macro, I have written an InputBox for the
user to enter his email address if he wants a copy.

I want the worksheet to be sent to the first particular
address (same one every time, hard coded in) as well as
the address input by the user.

This seems like it should be easy. I'm using .SendMail

How do I combine the two addresses?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Mail to multiple receipients

Try something like this:

Sub SendSheet()

Dim rec(2) As String

rec(1) = "
rec(2) = Application.InputBox("Type your e-mail address to get a copy")

ActiveWorkbook.SendMail Recipients:=rec(), Subject:="My subject"


End Sub

Jan

"Clapp" skrev i en meddelelse
...
I have a macro that is to automatically send the
worksheet to a particular email address.

At the end of a macro, I have written an InputBox for the
user to enter his email address if he wants a copy.

I want the worksheet to be sent to the first particular
address (same one every time, hard coded in) as well as
the address input by the user.

This seems like it should be easy. I'm using .SendMail

How do I combine the two addresses?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Mail to multiple receipients

Thank you so much for your help, but I am getting:

Run-time error '1004' General Mail Failure

???


-----Original Message-----
Try something like this:

Sub SendSheet()

Dim rec(2) As String

rec(1) = "
rec(2) = Application.InputBox("Type your e-mail

address to get a copy")

ActiveWorkbook.SendMail Recipients:=rec(),

Subject:="My subject"


End Sub

Jan

"Clapp" skrev i en

meddelelse
...
I have a macro that is to automatically send the
worksheet to a particular email address.

At the end of a macro, I have written an InputBox for

the
user to enter his email address if he wants a copy.

I want the worksheet to be sent to the first particular
address (same one every time, hard coded in) as well as
the address input by the user.

This seems like it should be easy. I'm using .SendMail

How do I combine the two addresses?



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Mail to multiple receipients

NO wait! Sorry, I had mistyped something. Your method
worked! Thank you!


-----Original Message-----
Thank you so much for your help, but I am getting:

Run-time error '1004' General Mail Failure

???


-----Original Message-----
Try something like this:

Sub SendSheet()

Dim rec(2) As String

rec(1) = "
rec(2) = Application.InputBox("Type your e-mail

address to get a copy")

ActiveWorkbook.SendMail Recipients:=rec(),

Subject:="My subject"


End Sub

Jan

"Clapp" skrev i

en
meddelelse
...
I have a macro that is to automatically send the
worksheet to a particular email address.

At the end of a macro, I have written an InputBox for

the
user to enter his email address if he wants a copy.

I want the worksheet to be sent to the first

particular
address (same one every time, hard coded in) as well

as
the address input by the user.

This seems like it should be easy. I'm using .SendMail

How do I combine the two addresses?



.

.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Mail to multiple receipients

Glad I Could help :-)

Jan--

"Clapp" skrev i en meddelelse
...
NO wait! Sorry, I had mistyped something. Your method
worked! Thank you!


-----Original Message-----
Thank you so much for your help, but I am getting:

Run-time error '1004' General Mail Failure

???


-----Original Message-----
Try something like this:

Sub SendSheet()

Dim rec(2) As String

rec(1) = "
rec(2) = Application.InputBox("Type your e-mail

address to get a copy")

ActiveWorkbook.SendMail Recipients:=rec(),

Subject:="My subject"


End Sub

Jan

"Clapp" skrev i

en
meddelelse
...
I have a macro that is to automatically send the
worksheet to a particular email address.

At the end of a macro, I have written an InputBox for

the
user to enter his email address if he wants a copy.

I want the worksheet to be sent to the first

particular
address (same one every time, hard coded in) as well

as
the address input by the user.

This seems like it should be easy. I'm using .SendMail

How do I combine the two addresses?


.

.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Mail to multiple receipients

Sorry, I spoke too soon.

In the SendMail statement I had written rec(2) instead of
rec(). When I corrected this, it worked. Several times in
a row.
Then I added the following line at the top of my macro:
Application.ScreenUpdating = False

That's all I added, and the next time I ran the macro, I
got the General Mail Failure error (1004). I removed the
statement but keep getting the error. I've even rebooted
the machine. Now, I cannot make it work again.

Any ideas?


-----Original Message-----
Glad I Could help :-)

Jan--

"Clapp" skrev i en

meddelelse
...
NO wait! Sorry, I had mistyped something. Your method
worked! Thank you!


-----Original Message-----
Thank you so much for your help, but I am getting:

Run-time error '1004' General Mail Failure

???


-----Original Message-----
Try something like this:

Sub SendSheet()

Dim rec(2) As String

rec(1) = "
rec(2) = Application.InputBox("Type your e-mail
address to get a copy")

ActiveWorkbook.SendMail Recipients:=rec(),
Subject:="My subject"


End Sub

Jan

"Clapp" skrev i

en
meddelelse
...
I have a macro that is to automatically send the
worksheet to a particular email address.

At the end of a macro, I have written an InputBox

for
the
user to enter his email address if he wants a copy.

I want the worksheet to be sent to the first

particular
address (same one every time, hard coded in) as

well
as
the address input by the user.

This seems like it should be easy. I'm

using .SendMail

How do I combine the two addresses?


.

.



.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Mail to multiple receipients

I'm not sure what happens. The screen updating ashould have nothing to do
with the Send Mail function. Have you tried copying the original code to
another workbook and try it there?

Jan

"Clapp" skrev i en meddelelse
...
Sorry, I spoke too soon.

In the SendMail statement I had written rec(2) instead of
rec(). When I corrected this, it worked. Several times in
a row.
Then I added the following line at the top of my macro:
Application.ScreenUpdating = False

That's all I added, and the next time I ran the macro, I
got the General Mail Failure error (1004). I removed the
statement but keep getting the error. I've even rebooted
the machine. Now, I cannot make it work again.

Any ideas?


-----Original Message-----
Glad I Could help :-)

Jan--

"Clapp" skrev i en

meddelelse
...
NO wait! Sorry, I had mistyped something. Your method
worked! Thank you!


-----Original Message-----
Thank you so much for your help, but I am getting:

Run-time error '1004' General Mail Failure

???


-----Original Message-----
Try something like this:

Sub SendSheet()

Dim rec(2) As String

rec(1) = "
rec(2) = Application.InputBox("Type your e-mail
address to get a copy")

ActiveWorkbook.SendMail Recipients:=rec(),
Subject:="My subject"


End Sub

Jan

"Clapp" skrev i
en
meddelelse
...
I have a macro that is to automatically send the
worksheet to a particular email address.

At the end of a macro, I have written an InputBox

for
the
user to enter his email address if he wants a copy.

I want the worksheet to be sent to the first
particular
address (same one every time, hard coded in) as

well
as
the address input by the user.

This seems like it should be easy. I'm

using .SendMail

How do I combine the two addresses?


.

.



.



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Mail to multiple receipients

Jan,

I've tried copying it to a completely new workbook, but
that doesn't work either.

There doesn't seem to be any rhyme or reason to the
error. I will try various things, such as remarking out
the input box statement or the sendmail and eventually
when I put them back in everything works. And will work
over and over. But as soon as I make ANY change to the
macro, even cosmetic (such as adding a remarked
statement), the error returns. I am running WXP SP2 with
Outlook 2003 as my mail client and Excel 2003. It seems
as if the sendmail statement is keeping a process hung up
somewhere. However, neither shutting down nor rebooting
seems to have any effect. I am copying the last part of
the macro below in case it helps. As you can see, this is
the section that prompts the user for an address and then
sends mail to that address as well as the static address.
I know this is difficult since it's not exactly
reproduceable, but any help you could give would be great
because the code (when it works) is EXACTLY what I want
to do.

Thanks!

' Get SLM address

Dim Message, Title, Default
Message = "Enter your email address: "
Title = "To receive a copy..."

Dim Add(2) As String
Add(1) = "
Add(2) = InputBox(Message, Title)

ActiveWorkbook.SendMail Recipients:=Add(),
Subject:="SW/Equip. Order for Cust: " & CustNum.Value
& " - " & OrdDate.Value

ActiveWindow.Close
Kill sPath & "SWE Order for Customer " & CustNum.Value
& ".xls"
Application.ScreenUpdating = True
Application.Quit

End Sub


-----Original Message-----
I'm not sure what happens. The screen updating ashould

have nothing to do
with the Send Mail function. Have you tried copying the

original code to
another workbook and try it there?

Jan

"Clapp" skrev i en

meddelelse
...
Sorry, I spoke too soon.

In the SendMail statement I had written rec(2) instead

of
rec(). When I corrected this, it worked. Several times

in
a row.
Then I added the following line at the top of my macro:
Application.ScreenUpdating = False

That's all I added, and the next time I ran the macro,

I
got the General Mail Failure error (1004). I removed

the
statement but keep getting the error. I've even

rebooted
the machine. Now, I cannot make it work again.

Any ideas?


-----Original Message-----
Glad I Could help :-)

Jan--

"Clapp" skrev i

en
meddelelse
...
NO wait! Sorry, I had mistyped something. Your

method
worked! Thank you!


-----Original Message-----
Thank you so much for your help, but I am getting:

Run-time error '1004' General Mail Failure

???


-----Original Message-----
Try something like this:

Sub SendSheet()

Dim rec(2) As String

rec(1) = "
rec(2) = Application.InputBox("Type your e-

mail
address to get a copy")

ActiveWorkbook.SendMail Recipients:=rec(),
Subject:="My subject"


End Sub

Jan

"Clapp"

skrev i
en
meddelelse
...
I have a macro that is to automatically send the
worksheet to a particular email address.

At the end of a macro, I have written an

InputBox
for
the
user to enter his email address if he wants a

copy.

I want the worksheet to be sent to the first
particular
address (same one every time, hard coded in) as

well
as
the address input by the user.

This seems like it should be easy. I'm

using .SendMail

How do I combine the two addresses?


.

.



.



.

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
Schedueled Auto Send .xls File to Receipients Anne Excel Discussion (Misc queries) 0 March 4th 10 06:02 PM
mail merge multiple lines in an e-mail Guy[_2_] Excel Discussion (Misc queries) 1 December 1st 09 08:32 PM
Truncated filenames by receipients Bill Excel Discussion (Misc queries) 2 August 24th 06 02:09 PM
Editing Multiple E-Mail Addresses... foofightin Excel Worksheet Functions 5 October 28th 04 07:40 PM
mail worksheet (multiple) stuart Excel Programming 4 August 12th 03 11:40 AM


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