"引用Microsoft Add-In Designer
Global gVBE As VBIDE.VBE "模块中
gVBE.ActiveCodePane.GetSelection sl, sc, el, ec "获取选中的行号
MsgBox gVBE.ActiveCodePane.CodeModule.ProcOfLine(sl, vbext_pk_Proc) "显示选中行所在的sub名称
Global gVBE As VBIDE.VBE "模块中
gVBE.ActiveCodePane.GetSelection sl, sc, el, ec "获取选中的行号
MsgBox gVBE.ActiveCodePane.CodeModule.ProcOfLine(sl, vbext_pk_Proc) "显示选中行所在的sub名称