When using On Error Resume Next it is best to reset to error trapping ASAP and then test if the Object status. Much better for identifying problems in the code.
Try the following adaption of your code.
Sub MPID()
Dim grabtext
Dim columnPos
Dim filelocation As String
Dim filename As Variant
Dim dt As String, wbNam As String
'**********************************************************************************
'Code between asterisk lines was commented out during testing
grabtext = session.screentext(7, 1, 1, 80)
columnPos = InStr(grabtext, "Mbr No: ")
grabtext = Trim(session.screentext(7, columnPos + 8, 1, 7))
If columnPos = 0 Then
MsgBox "MPID not found." + Chr(10) + "Must be on the Patient Information screen."
Exit Sub
End If
'***********************************************************************************
filelocation = "\dal-fs01\shared\rx tools\CUSTOMER SERVICE\RMS Opportunity Spreadsheet\Med_Management_Workbook.xlsm"
Dim XL As Object
Dim WB As Object
Dim ws As Object
Dim WBName As String
Dim OpenFile As Boolean
'grabtext = "My Test String" 'Used during testing by OssieMac
WBName = "Med_Management_Workbook.xlsm"
On Error Resume Next
Set XL = GetObject(, "Excel.Application")
On Error GoTo 0
If XL Is Nothing Then
Set XL = CreateObject("Excel.Application")
End If
On Error Resume Next
Set WB = XL.workbooks(WBName)
On Error GoTo 0
If WB Is Nothing Then
Set WB = XL.workbooks.Open(filelocation)
End If
Set ws = WB.worksheets(1)
XL.Visible = True
ws.Range("C5") = grabtext
End Sub