Dim pathLote As String = String.Empty If cklbFuncao.GetItemChecked(1) And (go = True) Then txtLog.Text += "Método: nfse.GeraLote" & vbCr & vbLf pathLote = nfse.GeraLote(path & "RPS-" & nRPS & ".xml", Convert.ToInt32(txtnNFSe.Text)) str = "#RETORNO: " & pathLote txtLog.Text += str & vbCr & vbLf & vbCr & vbLf If File.Exists(pathLote) Then go = True Else go = False txtLog.Text += "*** ATENÇÃO ***" & vbCr & vbLf & "Arquivo de Lote não localizado." & vbCr & vbLf & pathLote & vbCr & vbLf & vbCr & vbLf End If Application.DoEvents() End If