View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
bac bac is offline
external usenet poster
 
Posts: 76
Default Calling a common XLA Library file, stored on a network drive :)

In the workbook_open event

AddIns("Your Addin Title").Installed = False 'To remove current link
AddIns.Add Filename:= _
"\\servername\AddinDirectory\YourAddin.XLA"
AddIns("Your Addin Title").Installed = True

End Sub

Then everytime the user opens the file the open event will reconnect to the
latest version of the .xla which you will keep at:
"\\servername\AddinDirectory\YourAddin.XLA"

BTW- I got this code by using the macro recorder to connect to a .XLA on
one of our servers..That macrorecorder is a truly great tool..

BAC
"eXcellence" wrote:

Hi Forumites,

Im new to this forum, dont ya just love google!.
---


This should be an easy one for you.


I have a test XLA file, that i want to add more useful functions to, so

i can use this site wide.


For example:
-----
Public Function Get_Time() As Date
Get_Time = Time
End Function
Public Function Get_Date() As Date
Get_Date = Date
End Function
Function Trunc_String(InString As String, Chars As Long) As String
Trunc_String = Left(InString, Chars)
End Function


Public Function test_fun()
MsgBox ("fff")


End Function
-----


I want to be able to create Excel files that use these functions. then
give the Excel XLS file to the users. These are usually tools for
formatting/extracting data etc.


How can i ensure that when i give the file to a user, it will pick up
the latest XLA file. Id also like to put the XLA file on a network
drive, so we can all use the one library file.


Usually you need to add the XLA file to the references too, but i dont
(or cant rely) on the users to do this. i need the XLA file to be
called from the code in some way, so the user doesnt need to worry
about it.


Any suggestions please :)


Arty.