Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sending email from Excel vba problem


We have just upgraded from Office 97 to 2003.

I have an Excel macro that sends an email with Outlook to inform of
client changes. This worked fine in 97, but in 2003 you now get a
message box saying:

YOU HAVE A PROGRAM TRYING TO ACCESS ADDRESSES STORED IN OUTLOOK. DO YOU
WANT TO ALLOW THIS?

If you choose the Yes button 3 times it works, but choosing No brings
up a VB error. I have tried reducing the security level in Outlook, but
the message still appears.

Is it possible to hide this box and get it to choose Yes by default?

Paul


--
PaulC
------------------------------------------------------------------------
PaulC's Profile: http://www.excelforum.com/member.php...fo&userid=7563
View this thread: http://www.excelforum.com/showthread...hreadid=380386

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Sending email from Excel vba problem

Hi Paul

See
http://www.rondebruin.nl/mail/prevent.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl


"PaulC" wrote in message
...

We have just upgraded from Office 97 to 2003.

I have an Excel macro that sends an email with Outlook to inform of
client changes. This worked fine in 97, but in 2003 you now get a
message box saying:

YOU HAVE A PROGRAM TRYING TO ACCESS ADDRESSES STORED IN OUTLOOK. DO YOU
WANT TO ALLOW THIS?

If you choose the Yes button 3 times it works, but choosing No brings
up a VB error. I have tried reducing the security level in Outlook, but
the message still appears.

Is it possible to hide this box and get it to choose Yes by default?

Paul


--
PaulC
------------------------------------------------------------------------
PaulC's Profile: http://www.excelforum.com/member.php...fo&userid=7563
View this thread: http://www.excelforum.com/showthread...hreadid=380386



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sending email from Excel vba problem


Ron

Thanks for your reply. I will try as soon as I return from a trainin
course next week.

Pau

--
Paul
-----------------------------------------------------------------------
PaulC's Profile: http://www.excelforum.com/member.php...nfo&userid=756
View this thread: http://www.excelforum.com/showthread.php?threadid=38038

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sending email from Excel vba problem


Hi Ron

I have just installed Express ClickYes which is working - many thanks
for that. However, it brings up Outlook with the "Do you want to
allow...." message and when it has clicked on Yes, the email is sent,
but Outlook remains on top.

Is there a way of keeping Outlook hidden during this process (as
happened with Office 97) or at least returning to Excel at the end with
Client List Current.xls activated?

This is to stop users getting into the wrong version of Excel
afterwards.

The relevant bit of code I am using is:

Sub SendEmail()

Dim olApp As Outlook.Application
Dim olMail As MailItem

Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)

With olMail
..Recipients.Add "
..Subject = "IAS Reps Changes"
..Body = "Please find attached IAS and Reps changes Spreadsheet"
..Attachments.Add ActiveWorkbook.Path & "\" & ActiveWorkbook.Name
..ReadReceiptRequested = True
..Send
End With

Set olMail = Nothing
Set olApp = Nothing

Windows("Client List Current.xls").Activate
Sheets("Current").activate

End Sub


Thanks

Paul


--
PaulC
------------------------------------------------------------------------
PaulC's Profile: http://www.excelforum.com/member.php...fo&userid=7563
View this thread: http://www.excelforum.com/showthread...hreadid=380386

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Sending email from Excel vba problem

Hi Paul

I never used ClickYes

Can't you use CDO ?
http://www.rondebruin.nl/cdo.htm
No problems then



--
Regards Ron de Bruin
http://www.rondebruin.nl


"PaulC" wrote in message
...

Hi Ron

I have just installed Express ClickYes which is working - many thanks
for that. However, it brings up Outlook with the "Do you want to
allow...." message and when it has clicked on Yes, the email is sent,
but Outlook remains on top.

Is there a way of keeping Outlook hidden during this process (as
happened with Office 97) or at least returning to Excel at the end with
Client List Current.xls activated?

This is to stop users getting into the wrong version of Excel
afterwards.

The relevant bit of code I am using is:

Sub SendEmail()

Dim olApp As Outlook.Application
Dim olMail As MailItem

Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)

With olMail
Recipients.Add "
Subject = "IAS Reps Changes"
Body = "Please find attached IAS and Reps changes Spreadsheet"
Attachments.Add ActiveWorkbook.Path & "\" & ActiveWorkbook.Name
ReadReceiptRequested = True
Send
End With

Set olMail = Nothing
Set olApp = Nothing

Windows("Client List Current.xls").Activate
Sheets("Current").activate

End Sub


Thanks

Paul


--
PaulC
------------------------------------------------------------------------
PaulC's Profile: http://www.excelforum.com/member.php...fo&userid=7563
View this thread: http://www.excelforum.com/showthread...hreadid=380386





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sending email from Excel vba problem


Many thanks Ron. I will try CDO when we get back from Scotland mid
July.

Paul


--
PaulC
------------------------------------------------------------------------
PaulC's Profile: http://www.excelforum.com/member.php...fo&userid=7563
View this thread: http://www.excelforum.com/showthread...hreadid=380386

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
Have problem sending spreadsheet email and losing custom toolbar and macros memphoman Excel Discussion (Misc queries) 0 January 19th 06 08:40 PM
sending email from Excel nuExcel[_4_] Excel Programming 1 June 7th 04 04:24 AM
Sending email from Excel Denise Posey Excel Programming 9 February 4th 04 09:29 AM
sending email in Excel Peter W[_2_] Excel Programming 1 September 15th 03 04:13 PM
HELP sending email from Excel Memnoch Excel Programming 0 July 12th 03 02:18 PM


All times are GMT +1. The time now is 01:52 PM.

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"