Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
684
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub test()
  2. Dim i As Long
  3. i = 0
  4. Dim FileName As String
  5. Application.FileDialog(msoFileDialogOpen).Show
  6. FileName = Application.FileDialog(msoFileDialogOpen).SelectedItems(1)
  7. ScreenUpdating = False
  8. Line2: On Error GoTo Line1
  9. Documents.Open FileName, , True, , i & ""
  10. MsgBox "Password is " & i
  11. Application.ScreenUpdating = True
  12. Exit Sub
  13. Line1: i = i + 1
  14. Resume Line2
  15. ScreenUpdating = True
  16. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement