Quote: but the file is not opened or used by any other program
The file is not opened by another process but by your own application!
You have commented the
Dim FileStr As New FileStream("banking.xls", FileMode.Create, FileAccess.Write)
Dim a As New StreamWriter(FileStr)
FileStr = New FileStream("banking.xls", FileMode.Open, FileAccess.Read)