View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Import a CodeModule then call its method in Workbook_Open()

Just curious...

Why not just keep that code in another workbook (maybe an addin) and run the
code directly from there?



wrote:

I have a Module called "CodeFile.bas" which i Share amongst several
workbooks - It has a method called KickStart()

I want to do something like the following:

Private Sub Workbook_Open()

Me.VBProject.VBComponents.import "c:\CodeFile.bas"

Call KickStart()

End Sub

i.e. Import the code file and then subsequently call one of its
methods.

Any ideas how I could achieve this effect.

Dickster


--

Dave Peterson