Function Broj_Racuna() Dim temp As String Dim Poz, Poz2, Poz3, Pozz As Integer Const Putanja_Filea1 = "C:\Tring\stampatifiskalniracun11.xml" Close #1 Open Putanja_Filea1 For Input As 1 For x = 1 To 6 Line Input #1, temp Next x Poz = InStr(1, temp, ">") Pozz = InStr(1, temp, "t>") broj_racuna2 = Mid(temp, 38 + 1, Pozz - 50) kraj: MsgBox "BF: " & broj_racuna2 Close #1 End Function