Programming Questions? Ask a Programmer for Answers ASAP
what do you mean by modules.
if you could send an example file of what you are looking to do I will take a look at it tomorrow as it is late where I am
really not sure what you are getting at, so I will open it to other experts.
Hi there and welcome
This is the code you would need to use
Option Explicit 'http://www.tech-archive.net/Archive/Excel/microsoft.public.excel/2009-03/msg00695.htmlSub importBas()Dim VBProj As Object 'VBIDE.VBProject Dim myFileName As StringmyFileName = "C:\folder\file.bas"Set VBProj = Nothing On Error Resume Next Set VBProj = ActiveWorkbook.VBProject On Error GoTo 0If VBProj Is Nothing Then MsgBox "Can't continue--I'm not trusted!" Exit Sub End IfVBProj.vbcomponents.Import myFileNameEnd Sub
This will import it into the current spreadsheet
Let me know if you have any problems please