View Single Post
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Have you tried?

MsgBox application.run("Excel_Library3.xla!get_date()")

--

HTH

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


"eXcellence" wrote in message
ups.com...
Hiya Forumittes,

Progress!!!

I can now call and update a Library (xla) file from the network and
install it when the workbook opens.

But << there is always a but...

1) I call and install the Library file.

Private Sub Workbook_Open()

Application.DisplayAlerts = False

AddIns("Excel_Library3").Installed = False 'To remove current link
AddIns.Add Filename:= _

"G:\Users\Development_Applications\Site_Library\Ex cel_Library3.xla"
AddIns("Excel_Library3").Installed = True
Application.DisplayAlerts = True

If AddIns("Excel_Library3").Installed = True Then
MsgBox "add-in is installed"
Else
MsgBox "add-in is not installed"
End If
End Sub


* Good so far... i get a message saying "add-in is installed"

2) for testing i have put a button on the sheet just to call a function
in the library.

Private Sub CommandButton1_Click()
MsgBox (get_date())
MsgBox (get_time())
End Sub

* I push the button and i get an error "Sub or Function not defined"

* i stop the program and look at the references, the library is NOT
ticked.
* if i tick it, and type in "get_" (then press Ctl_Space, to do a word
completion the function "get_date and get_time" are visible.

* i run the program again. and it fails.

----
This is the code in the library, all PUBIC stuff, so im at a loss.

Public Function Get_Time() As Date
Get_Time = Time
End Function
Public Function Get_Date() As Date
Get_Date = Date
End Function

-------

Im soooo close, i recon, i need to force the TICK somehow, but i
thought this piece of code did that:

AddIns("Excel_Library3").Installed = True