drom
Active Member
- Joined
- Mar 20, 2005
- Messages
- 491
- Office Version
-
- 2019
- 2016
- 2013
- 2011
- 2010
- 2007
Hi and Thanks in advance!
ref.: IMPORT ThisWorkBook.cls file when coming from explorer with a different name.
When I import from a folder "eg: C:\MrExcel" a few .CLS, files using:
is there any way to know if the imported file that goes to the ClassModule place, is a ThisWorkBook Module and not a sheet module or a Class module?
When you change the name of the ThisWorkBook.CLS file using Explorer to say "MyThisWKB.CLS"
If you import this File "ThisWKB.CLS":
Excel Knows ThisWKB.cls is a ThisWorkbook module file, because the imported file comes with a different name than ThisWKB.
How does it excel excel know if is a ThisWorkBook module file?
ref.: IMPORT ThisWorkBook.cls file when coming from explorer with a different name.
When I import from a folder "eg: C:\MrExcel" a few .CLS, files using:
Code:
For X = LBound(aFiles) To UBound(aFiles)
FxName = Left(aFiles(X), InStrRev(aFiles(X), ".") - 1)
If LCase(Right(aFiles(X), 4)) = ".cls" Then
With ActiveWorkbook.VBProject
.VBComponents.Remove .VBComponents(FxName)
.VBComponents.Import aFiles(X)
End With
End If
FxName = ""
Next X
is there any way to know if the imported file that goes to the ClassModule place, is a ThisWorkBook Module and not a sheet module or a Class module?
When you change the name of the ThisWorkBook.CLS file using Explorer to say "MyThisWKB.CLS"
If you import this File "ThisWKB.CLS":
Excel Knows ThisWKB.cls is a ThisWorkbook module file, because the imported file comes with a different name than ThisWKB.
How does it excel excel know if is a ThisWorkBook module file?