View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Importing Macros

Daren,

Is there a specific file that you need to have the BAS imported into, or just have it available?

In the first case, you could write a macro like this (with a reference set to MS VBA Extensibility)

Sub AddModuleByImportToPersonalXLS()
Dim myBook As Workbook
Dim myFile As String

myFile = "C:\Excel\myVBAFileName.bas"
Set myBook = Workbooks("Personal.xls")
myBook.VBProject.VBComponents.Import (myFile)
End Sub


If it just needs to be available, make your file into an add-in....

HTH,
Bernie
MS Excel MVP


"Daren" wrote in message
...
I have some macros saved as .bas files that people need to be able to import
into their Excel. Their experience on importing is limited, so I need to be
able to explain to them how to import these files. Is there an easy way to
import the .bas files into Excel?

Thanks.