A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

error popup coming unnecessarily



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 6th 08, 01:57 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default error popup coming unnecessarily

Either put an Exit Sub statement before the Error: block or put the MsgBox inside an If Err 0 ... End If block. Code execution is going right through your Error: block.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Dickery1" wrote in message ...
Hello
I have a fully working code but for some reason it still triggers the
err block. can someone tell me why. I get a msgbox with Error 0 in it.
i thoght that they get triggered only if there is a error.


Sub MovePastDate2Today()
On Error GoTo MovePastDate2Today_Error
Dim t As TaskItem
Set f =
Application.GetNamespace("MAPI").GetDefaultFolder( olFolderTasks)
strText = ""
For Each t In f.Items
If (t.DueDate Date And Not (t.Status = olTaskComplete)) Then
'strText = strText & (t.DueDate) & " "
t.DueDate = Date
t.Save

End If
Next

'MsgBox strText
'MsgBox Date




MovePastDate2Today_Error:
MsgBox "Error " & Err.Number & "(" & Err.Description & ")"




End Sub

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Where are they coming from? C-Dog Outlook - Using Contacts 4 September 14th 07 04:27 PM
Error message in mircosoft word in mail merge coming frm outlook03 Jessica Outlook - Using Contacts 1 May 15th 07 09:53 PM
It Keeps Coming Ron Outlook Express 6 October 10th 06 10:52 PM
Strange error coming from OUTLOOK... Karan Outlook - General Queries 0 June 13th 06 05:36 AM
Help-Error msg popup "A program is trying to access email addresses. . ' WF Outlook - General Queries 1 April 29th 06 01:08 AM


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.