Hi,
I am pretty new to Excel vba. I have run into an error I haven't found any resolution for.
When I run the script, the message box will pop up and provide me the info. I click OK and it closes.
But when I run it again, it pops up again, but then the code box as well as MS Excel is frozen.
I have to force close Excel through task manager to exit.
Here is the code I have:

Sub FileName ()

' This is a way to get the file name in a messagebox
' After clicking OK, the messagebox should close
' The filename should not show the file extension

Dim FileName As String
FileName = ThisWorkbook.Name
FileName = Left(FileName, Len(FileName)-5)

'Variable declaration
Dim Output as Integer

'Example vbOKOnly
Output = MsgBox ("The name of this file is " & FileName, vbOKOnly, "Get file name")

End Sub

What am I doing wrong?
Thanks for any help

Adutchbrew