[dba-VB] CreateObject, GetObject Functions

Adam Borrie AdamB at peabody.org.uk
Thu May 13 08:41:42 CDT 2004


Bryan you're a star!

I had just come to the conclusion that I would have to error trap it, so
thanks for the code.

Adam Borrie
Systems Manager
Peabody Trust
*  0207 021 4439
* adamb at peabody.org.uk

> ----------
> From: 	Bryan Carbonnell[SMTP:Bryan_Carbonnell at cbc.ca]
> Reply To: 	dba-vb at databaseadvisors.com
> Sent: 	13 May 2004 14:18
> To: 	dba-vb at databaseadvisors.com
> Subject: 	Re: [dba-VB] CreateObject, GetObject Functions
> 
> Adam,
> 
> Here is how I deal with this:
> 
>   'Temporarily disable error handling
>   On Error Resume Next
>   'Get a reference to an already open session on Excel
>   Set objXL = GetObject(, "Excel.Application")
>   'Check to see if everything is ok
>   If objXL Is Nothing Then
>     'Object is nothing, which means Excel is not open
>     Set objXL = CreateObject("Excel.Application")
>     bolWeLoaded = True
>   End If
>   
>   'Restore proper error handling
>   On Error GoTo cmdExcel_Click_Error
> 
> 
> Bryan Carbonnell
> bryan_carbonnell at cbc.ca
> 
> >>> AdamB at peabody.org.uk 13-May-04 9:10:47 AM >>>
> Question:
> 
> I am trying to set the value of a Boolean variable on the basis of
> whether
> an instance of Excel is running.  In doing this I can then determine
> whether
> to perform a CreateObject or GetObject function.
> 
> Do any of you have any suggestions.
> _______________________________________________
> dba-VB mailing list
> dba-VB at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-vb
> http://www.databaseadvisors.com
> 

#####################################################################################
This e-mail message has been scanned for Viruses and Content and cleared 
by MailMarshal
For more information please visit www.marshalsoftware.com
#####################################################################################

This email and any files transmitted with it are confidential and intended
solely for the use of the individual to whom it is addressed. Any views or 
opinions presented are solely those of the author and do not necessarily 
represent those of the Peabody Trust.

If you are not the intended recipient, be advised that you have received this 
email in error and that any use, dissemination, forwarding, printing, or 
copying of this email is strictly prohibited. If you have received this email 
in error please notify the Peabody Trust IT Help Desk either by;

Emailing helpdesk at peabody.org.uk 

Or by telephone on 020 79287811

Peabody Trust - http://www.peabody.org.uk

Please note that Peabody Trust encorporates  Waltham Forest Community Based Housing Association and Safe in the City.

This footnote also confirms that MailMarshal and Network Associates Total 
Virus Defense software's have swept this email message for the presence of 
computer viruses http://www.marshalsoftware.com and http://www.nai.com



More information about the dba-VB mailing list