PDA

View Full Version : Import *.bas in same directory



ms06f
02-12-2012, 01:08 AM
ActiveWorkbook.VBProject.VBComponents.Import ("d:\Test00.bas")

This VBA is import Test00.bas from D drive root directory.

In my directory have book1.xls and Test00.bas at X:\.....\
Book1.xls how to import Test00.bas in same directory?


Help me PLEASE.

Bob Phillips
02-12-2012, 06:20 AM
With ActiveWorkbook

.VBProject.VBComponents.Import (.Path & "\Test00.bas")
End With

ms06f
02-14-2012, 07:27 AM
thankyou for your help.
but my office ver. is too old

.VBProject.VBComponents.Import (ThisWorkbook.Path & "\Test00.bas")

can work in my office 2000

Bob Phillips
02-14-2012, 08:10 AM
Try it and see.