S
Shatin
I got the following lines in my macro:
Dim VBCodeMod As CodeModule
Dim LineNum As Long
ActiveWorkbook.VBProject.VBComponents.Add vbext_ct_StdModule
Set VBCodeMod = Application.VBE.CodePanes(1).CodeModule
I think I copied those lines from the Pearson site. When I run the
macro from my personal.xls file, the macro runs without any problem.
However, when I copy the macro to a new file in the document folder,
the line "VBCodeMod As CodeModule" is highlighted and this error msg
appears:
Compile error:
User-defined typ not defined
Can someone please tell me what this error is? And why this error
since the macro runs problem free from the personal.xls?
TIA.
Dim VBCodeMod As CodeModule
Dim LineNum As Long
ActiveWorkbook.VBProject.VBComponents.Add vbext_ct_StdModule
Set VBCodeMod = Application.VBE.CodePanes(1).CodeModule
I think I copied those lines from the Pearson site. When I run the
macro from my personal.xls file, the macro runs without any problem.
However, when I copy the macro to a new file in the document folder,
the line "VBCodeMod As CodeModule" is highlighted and this error msg
appears:
Compile error:
User-defined typ not defined
Can someone please tell me what this error is? And why this error
since the macro runs problem free from the personal.xls?
TIA.