Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Trapping the "Can't find project or library error"

Hi
I have many workbooks on a school system that make reference to a common
Addin for the macros required. Sometimes when a workbook is loaded for
the first time, it does not know where the reference Addin workbook is
located. This generates the following error:
Compile error:
Can't find project or library

- and also places the unsuspecting user in the VBE mode.

How can I trap this event ?

Thanks in advance

Andrew Bourke
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Trapping the "Can't find project or library error"

Hi Andrew,

A simple way would be to have a dummy function in the add-in, and make a
call to it early in your code. You can determine there whether the add-in is
loaded or not

Dim myVal
On Error GoTo no_addin
myVal = Application.Run("myAddin.xla!myFunc")
Exit Sub

no_addin:
MsgBox "Add-in not installed"


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ajtb" wrote in message
...
Hi
I have many workbooks on a school system that make reference to a common
Addin for the macros required. Sometimes when a workbook is loaded for
the first time, it does not know where the reference Addin workbook is
located. This generates the following error:
Compile error:
Can't find project or library

- and also places the unsuspecting user in the VBE mode.

How can I trap this event ?

Thanks in advance

Andrew Bourke



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
Excell error "Can't find Project or Library" Project VBAProject Lost in Excel Excel Worksheet Functions 0 April 12th 07 04:42 PM
indirect.ext - "can't find project or library" error DDawson Excel Worksheet Functions 0 December 5th 06 09:52 PM
Trim: Excel 97 gives error "Can't find project or library" Jim Mooney Excel Programming 10 August 30th 04 08:22 PM
adding reference "can't find project or library" yule1111 Excel Programming 1 July 18th 04 03:22 PM
macro error "can't find project or library" Meinfs Excel Programming 3 September 14th 03 04:29 PM


All times are GMT +1. The time now is 09:46 AM.

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"