#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Code Query

Can anyone let me know what these two lines do in a code?


Set OutMail = Nothing

Set OutApp = Nothing

Its just that I have a suspition its stopped my
send/receive in outlook
Many thanks in advance
John
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Code Query

Basically, it is clearing down the two object variables. Somewhere
previously the code will have set those objects, but if they are set to
nothing before you have finished, that is before the statement

OutMail.Send (or maybe OutMail.Display)

then you have a problem, if it comes after, that is not the problem.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"JohnUK" wrote in message
...
Can anyone let me know what these two lines do in a code?


Set OutMail = Nothing

Set OutApp = Nothing

Its just that I have a suspition its stopped my
send/receive in outlook
Many thanks in advance
John



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Code Query

All that code does is remove all references from the variable. It i
used to free up memory and should not have anything to do with removin
your send/receive. Somewhere above these lines of code there wa
probably a line saying something like:

Set OutMail = CreateObject("SomeObject")

This deletes that reference.



--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Code Query

I think it is more likely to be

Set OutMail = OutApp.CreateItem(olMailItem)

or

Set OutMail = OutApp.CreateItem(0)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"kkknie " wrote in message
...
All that code does is remove all references from the variable. It is
used to free up memory and should not have anything to do with removing
your send/receive. Somewhere above these lines of code there was
probably a line saying something like:

Set OutMail = CreateObject("SomeObject")

This deletes that reference.

K


---
Message posted from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Code Query

Its just that I have a suspition its stopped my
send/receive in outlook


Maybe the OP have a problem with this

If you look in the Task manager (Ctrl-Alt-Del) and still see Outlook.exe with
Outlook closed then look here
http://www.rondebruin.nl/sendmail.htm#Introduction

See the part about the bug in Outlook

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


"JohnUK" wrote in message ...
Can anyone let me know what these two lines do in a code?


Set OutMail = Nothing

Set OutApp = Nothing

Its just that I have a suspition its stopped my
send/receive in outlook
Many thanks in advance
John



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
Code To Refresh Query Table Carl Excel Discussion (Misc queries) 0 December 8th 06 01:23 AM
QUERY & HELP: so slow executing VBA code... :S John Keith Excel Worksheet Functions 3 February 13th 06 03:47 PM
Query on small piece of code Mike[_65_] Excel Programming 7 March 4th 04 03:23 PM
Code to run an Access query from Excel Kelly[_7_] Excel Programming 3 January 17th 04 04:12 PM
query source code Mel[_7_] Excel Programming 1 August 29th 03 11:24 PM


All times are GMT +1. The time now is 10:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"