ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how can i get rid of dialog box? (https://www.excelbanter.com/excel-programming/309039-how-can-i-get-rid-dialog-box.html)

jason t

how can i get rid of dialog box?
 
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



Tom Ogilvy

how can i get rid of dialog box?
 
To the best of my knowledge,
It is a built in security feature of outlook. It can't be turned off.

You can use CDO to avoid it. See Ron de Bruin's site:

http://www.rondebruin.nl/index.html

--
Regards,
Tom Ogilvy


"jason t" <jason wrote in message
...
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






All times are GMT +1. The time now is 03:39 PM.

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