missing library makes Format() disappear

D

Dan Williams

“Company XYZ” customized one of my subroutines, and this requires a
Reference to “AdapterRDC 1.0 Type Library”. I’m guessing that they
created this library.

I’m trying to give my spreadsheet to a user who does not have this
library. They only need to run a different subroutine, which does NOT
use this library.

But they get this error.

Compile error:
Can’t find project or library

....and the VBA code that is highlighted is an ordinary Format()
function.

Why would this happen? Even as a worst case, if the extra library
were to redefine the Format() function, you’d think that when the
library is missing, VBA would be able to find Format() where it
normally finds it.

As a temporary fix, I can give each user a copy of the library’s file,
"AdapterRDC.dll". This works.

Is there some sane explanation for this and/or a better fix?

Excel 2003
Windows 2000
Other libraries referenced:
Visual Basic for Applications
Microsoft Excel 11.0 Object Library
OLE Automation
Microsoft Office 11.0 Object Library
Microsoft Forms 2.0 Object Library
Microsoft Remote Data Object 2.0
Microsoft Scripting Runtime

Dan Williams
danwPlanet
 
B

Bob Phillips

Just go into Tools>References in the VBIDE and you will see that item with
MISSING alongside it. Uncheck it.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

“Company XYZ” customized one of my subroutines, and this requires a
Reference to “AdapterRDC 1.0 Type Library”. I’m guessing that they
created this library.

I’m trying to give my spreadsheet to a user who does not have this
library. They only need to run a different subroutine, which does NOT
use this library.

But they get this error.

Compile error:
Can’t find project or library

....and the VBA code that is highlighted is an ordinary Format()
function.

Why would this happen? Even as a worst case, if the extra library
were to redefine the Format() function, you’d think that when the
library is missing, VBA would be able to find Format() where it
normally finds it.

As a temporary fix, I can give each user a copy of the library’s file,
"AdapterRDC.dll". This works.

Is there some sane explanation for this and/or a better fix?

Excel 2003
Windows 2000
Other libraries referenced:
Visual Basic for Applications
Microsoft Excel 11.0 Object Library
OLE Automation
Microsoft Office 11.0 Object Library
Microsoft Forms 2.0 Object Library
Microsoft Remote Data Object 2.0
Microsoft Scripting Runtime

Dan Williams
danwPlanet
 
J

Jim Thomlinson

Look into late binding. In Early binding you create the link to the library
file at design time. With late binding you create the link ar run time. This
allows you to handle errors if the file is not found. You can search this
forum for CreateObject which will give you lots of examples of late binding
and probably a better explanation than what I am giving here...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top