Library references

  • Thread starter Thread starter Amanda
  • Start date Start date
A

Amanda

I have an application that gets deployed to several
different computers (with different OS and Excel
versions). Within the Excel application there are several
macros. I need to use many of the supplied Excel
library's. I add a reference to them, and compile my
project. I even have a function that searches to find any
missing libraries, it them removes the missing libraries
and readd's them by using both the name and the GUID.
Unforntunatley, if the library reference name is
unrecongized by a different version of Excel, it will not
perform the correct actions. Instead, it will leave it
missing. When this happens, all following libraries
(whether missing or not) are not recongnized, and
therefore, my excel application produces an application
error.
I was thinking that I should create some DLL or something
to prevent this from happening, but I am having no luck. I
have had this problem for a really long time, and could
use any form of advice that anyone has.

Thanks in advance!
 
Amanda,

Use late binding.

So instead of something like

Dim oOL as Outlook.Application

Set oOL = New OutLook.Application

which needs a reference, use

Dim oOL as Object

Set oOL = CraeteObject("Outlook.Application")

you won't be able to use of that app's constant variab le (such as xlYes in
Excel), but you can build with early binding, get the values, and change to
late bindin g when ready to distribute.

Here's a link to a previous, fuller, post of mine on the subject

http://makeashorterlink.com/?N32B22AF6

--

HTH

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