Hello,

After a Windows 11 reinstall I've been having many problems with my custom VBA modules. This one has me stumped.

I'm getting a 'Variable not defined' error when invoking oVBProject despite having VBA extensibility enabled.

tFile = Dir(CodePath & FolderModules & "*.bas")
    Do While tFile <> ""
      lblComponent = tFile
      oVBProject.VBComponents.Import CodePath & FolderModules & tFile
      Count = Count + 1
      tFile = Dir
    Loop
Thanks in advance for your kind help.