Sendmail and Lotus Notes trouble

C

CLR

Hi All.......
I'm using a modified version of Ron DeBruin's email code to send portions of
a sheet to vendors. The sheet is all calculated against cell A1 which is
the Vendor code...all other info is looked up on the database and or
calculated.......I just set a vendor number in A1 and press the
button.....all's well, the email goes out and control returns to Excel 2k,
however.........when I make another macro to feed numbers in to A1 and then
call my email routine, to send multiple emails, it sends the first one fine,
then locks up in Lotus and does not return control to Excel so I can put
another vendor number in A1.........

If I insert a msgbox between the snippets for each Vendor number it works
fine, but then I must manually OK the msgbox before the code will
continue.......I would rather it all ran automatically.......

Any ideas about how to return control to Excel? Just selecting a sheet, or
cell don't do it.
TIA

Vaya con Dios,
Chuck, CABGx3
 
W

ward376

Maybe it's a time thing. Try making Excel wait a few seconds between
each send.

Definitely check out Dennis' site that Ron mentioned also.

Cliff Edwards
 
C

CLR

Thanks for that idea Cliff.........how do I go about doing that?

Here's my Batch code.........the SendEmail macro works fine on a
one-shot.....this batch macro runs to get into Lotus the first time and then
never comes back so I can process the "next r" step

Sub Batchemail()
Dim lastrow As Long, r As Long
Sheets("All12").Select
Range("A12").Select
Selection.Sort Key1:=Range("Q12"), Order1:=xlAscending, Header:=xlGuess,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
lastrow = Cells(Rows.Count, "Q").End(xlUp).Row
For r = lastrow To 12 Step -1
If Cells(r, "Q") = Range("DATA!k2").Value Then
Cells(r, "Q").Select
Range("ReportCard!A1").Value = Selection.Offset(0, -16).Value
Call SendEmail 'this is the email macro that works by itself ok
End If
Next r
MsgBox "ALL THROUGH!"
End Sub

TIA
Vaya con Dios,
Chuck, CABGx3
 
W

ward376

You can try using a line like this between sends in your sendemail
procedure...
Application.wait Now + TimeValue("00:00:03")

Sub example()
Cells.Select
Application.wait Now + TimeValue("00:00:03")
Cells(1, 1).Select
MsgBox "Done Waiting"
End Sub

Cliff Edwards
 
C

CLR

Thanks Cliff, I'll give it a shot. I only have OE5 here at home, the Lotus
Notes is at work and our Factory is closed 'till the 7th, but I will sure be
happy to have something to try when I get back......this thing has been
bugging me for several days........nobody at work likes Lotus Notes, but our
IS dept has jammed it down our throats.......

Whether it works or not to solve my problem, I appreciate your response, and
also I've learned something new.....I've wondered how to pause processing in
other apps.

Thanks much
Vaya con Dios,
Chuck, CABGx3
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top