Create a folder:
"C:/DynaLoad"
Open a new workbook, add a module,
rename the module "DynaMod"
Place the following procedure into
the module:
Sub LoadDynaTest()
Sheet1.Range("A1") = "Tis' Loaded!"
End Sub
Export the module into folder
"C:/DynaLoad"
Now remove the module from your
workbook all together.
Insert another module into this
workbook(name does not matter)
Place this sub in the module:
Sub CallDynaLoadedProcedure()
LoadDynaTest
End Sub
In whatever way you want to call it, call it:
The example here loads the module when the workbook opens.
Private Sub Workbook_Open()
Application.VBE.ActiveVBProject.VBComponents.Import "C:/DynaLoad/DynaMod.bas"
CallDynaLoadedProcedure
End Sub
You cannot call the procedure directly
until the bas file is loaded or you will get a compile error. That is why
we have the middleman procedure.
Save the workbook. Close it.
Open it. Check sheet1.Range("A1")
Your module is loaded into the project if the range has the data...
Tom
This message was edited by TsTom on 2002-04-23 21:13