You're not missing anything. Exporting any of the Sheet modules or the
ThisWorkbook module creates a file with a .cls extension. The import
process can't determine that the class file is ThisWorkbook or a Sheet
module. ("Can't" isn't the right term. "Doesn't" is better -- it could
have been done, but wasn't.) You can import the file with VBA's I/O
procedures:
Sub AAA()
Dim FNum As Integer
Dim FName As String
Dim S As String
Dim N As Long
FName = "C:\ThisWorkbook.cls" '<<< CHANGE FILE NAME
FNum = FreeFile
Open FName For Input Access Read As #FNum
With
ThisWorkbook.VBProject.VBComponents("ThisWorkbook").CodeModule
.DeleteLines 1, .CountOfLines
Line Input #FNum, S
' skip headers
For N = 1 To 8
Line Input #FNum, S
Next N
Line Input #FNum, S
Do Until EOF(FNum)
.InsertLines .CountOfLines + 1, S
Line Input #FNum, S
Loop
.InsertLines .CountOfLines + 1, S
End With
End Sub
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)