Hello,
I am trying to get VBA to import a folder of .bas files into the PERSONAL.xlsb workbook upon Excel startup to ensure that users always have the most updated macros. Two lines of mine are throwing Runtime Error 9, and after playing around a bit I think it's either because I'm using Dir or there's something wrong with this line: *If IsNull(TargetWB.VBProject.VBComponents(fileNameNoExt)) = True Then Is Nothing Then*, but I'm not sure it that's what's wrong or how to fix it. (When I substitute an existing module name in quotes (no extension) for fileNameNoExt, there is no error in the AutoUpdateBasFiles sub, only in the DeleteVBComponent Sub. When I substitute a non-existent module name in quotes (no extension) for fileNameNoExt, it throws Runtime Error 9 again.) I am a novice with VBA. Any help or ideas would be appreciated.
Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #2 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer
![]()
Please Login or Register to view this content.
Bookmarks