ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Userform help needed (https://www.excelbanter.com/excel-programming/394202-userform-help-needed.html)

Corey G

Userform help needed
 
Hi,

I have a macro that sends emails. The send email feature is in a
loop
so it could possibly send out multiple emails to multiple addresses.
Before the email is sent, I have a Userform that pops up and tells
you
what information you are about tho send. I hit Continue (which does
"Unload Me") and the email is sent.


Let's say there are two emails that are going to go out though. The
form pops up, the email is sent, and then.....


nothing seems to happen.


As soon as I click on Excel though, the next dialog box pops up (with
the info that will be sent in the second email) and everything goes
out fine. So, I'm not sure why the focus for the second user form is
lost? I've tried a few things, but can't figure it out.


I bring up the form like this:


UserForm1.TextBox1.MultiLine = True
formbody = "To: " & contactArray(z) &
vbCrLf & "Subject: " & strsub & vbCrLf & vbCrLf & formbody
UserForm1.TextBox1.Value = formbody
UserForm1.Show


Thanks in advance for any advice/help with this.


JLGWhiz

Userform help needed
 
It would be more helpful to see the entire code loop.

"Corey G" wrote:

Hi,

I have a macro that sends emails. The send email feature is in a
loop
so it could possibly send out multiple emails to multiple addresses.
Before the email is sent, I have a Userform that pops up and tells
you
what information you are about tho send. I hit Continue (which does
"Unload Me") and the email is sent.


Let's say there are two emails that are going to go out though. The
form pops up, the email is sent, and then.....


nothing seems to happen.


As soon as I click on Excel though, the next dialog box pops up (with
the info that will be sent in the second email) and everything goes
out fine. So, I'm not sure why the focus for the second user form is
lost? I've tried a few things, but can't figure it out.


I bring up the form like this:


UserForm1.TextBox1.MultiLine = True
formbody = "To: " & contactArray(z) &
vbCrLf & "Subject: " & strsub & vbCrLf & vbCrLf & formbody
UserForm1.TextBox1.Value = formbody
UserForm1.Show


Thanks in advance for any advice/help with this.




All times are GMT +1. The time now is 12:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com