how can i get rid of dialog box?

J

jason t

When i run this script on excel 2003 I get "A program is trying to
automatically send e-mail on your behalf". How do i get rid of this?

Sub Time_set()
Sheets("Sheet1").Select
Range("AA1").Select
ActiveSheet.PivotTables("PivotTable3").PivotCache.Refresh
Sheets("Sheet5").Select
Range("B47").Select
If Application.Sheets("Sheet5").Range("B47") > 0 Then
Workbooks("mail.XLS").HasRoutingSlip = False
With Workbooks("mail.XLS").RoutingSlip
.Delivery = xlOneAfterAnother
.Recipients = "my address"
.Subject = "hello"
.Message = Workbooks("mail.XLS").Sheets("Sheet1").Range("A1")
End With
Workbooks("mail.XLS").Route
Else
End If
Application.OnTime Now + TimeValue("00:30:00"), "time_set"
Range("B47").Select


End Sub
 

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