Determining if a library exists 
Author Message
 Determining if a library exists

How do I detect if a library is available at run time?  For example, if I
write VB code that references Microsoft Excel's object library (MSXL8.OLB) I
can easily start Excel and create workbooks, worksheets and other objects.
However, if the same code runs on a machine on which Excel is not installed
I get an error.

I would like to check that the Excel objects library is installed so I can
disable any functions that aren't available.  Any ideas?

Thanks,

Dom



Fri, 05 Jul 2002 03:00:00 GMT  
 Determining if a library exists

Quote:
> How do I detect if a library is available at run time?  For example, if I
> write VB code that references Microsoft Excel's object library (MSXL8.OLB)
I
> can easily start Excel and create workbooks, worksheets and other objects.
> However, if the same code runs on a machine on which Excel is not
installed
> I get an error.

> I would like to check that the Excel objects library is installed so I can
> disable any functions that aren't available.  Any ideas?

Try to create an instance of Excel via CreateObject, using an error-handler.
If it fails, you have to disable your function. At that time the reason for
the failure does not matter...

Regards,

Harald M. Genauck

ABOUT Visual Basic - das Webmagazin
http://www.aboutvb.de



Fri, 05 Jul 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Do DSO .Net libraries exist ?

2. Name conflicts with existing module, project or object library

3. Math libraries Do They Exist

4. Does a VBA Code Library Exist?

5. Help: Name conflicts with existing module, project or object library

6. Binary compatibility, Public Class, Name conflicts with existing module, project, or object library

7. Name Conflicts with existing module, project or object library

8. Name conflicts with existing module, project or object library

9. Determining if Control Exists

10. How to determine if an object exists?

11. How to determine if CommandBar exists

12. Determining if a file exists

 

 
Powered by phpBB® Forum Software