The following example uses the CodePane and TopLine properties to display the number of the top line in the code module of the selected VBComponent object.
Debug.Print Application.VBE.SelectedVBComponent.CodeModule.CodePane.TopLine