Hi Duncan, I wrote a WAsP report script that only applies to wind farm hierarchy members, so it requires a wind farm to be selected. However, I'll be distributing this script to many "civilians", and to pre-empt a million questions and "bug" reports, I'd like the script to appear in WAsP's Reports menu even when no wind farm is selected, in which case it would return a helpful MsgBox when run. I tried the code below, but this doesn't capture the error in VBScript but rather in the WAsP Script Debugging Assistant, hence no civilan-friendly MsgBox. Any suggestions? Is there a method that returns the class of the currently selected hierarchy member so I can test for it in the script? On Error Resume Next Set WindFarm = ReportingAssistant.CastableSelectedMember.AsIWindFarm On Error GoTo 0 If Err.Number 0 Then MsgBox ("Please select a wind farm in the hierarchy.") Exit Sub End If