it is best to Define your Variables before using them:it is not really an Error.Dim tFile As String, lblComponent As String Dim Count As Long tFile = Dir(CodePath & FolderModules & "*.bas") Do While tFile <> "" lblComponent = tFile oVBProject.VBComponents.Import CodePath & FolderModules & tFile Count = Count + 1 tFile = Dir Loop
you have:
Option Explicit
on your module Declaration.