Advertisement
Guest User

Untitled

a guest
Oct 25th, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. Private Sub cbn_RunExtreme_Click()
  2.  
  3. WBpath = Application.ActiveWorkbook.Path
  4.  
  5. Set checksOutput = CreateObject("Scripting.FileSystemObject")
  6. Set textFile = checksOutput.OpenTextFile(WBpath & "/checklog" & ".txt", 8, True)
  7.  
  8. textFile.Writeline "Checks for extreme small or big values:"
  9. textFile.Writeline "_______________________________________"
  10. textFile.Writeline Now()
  11.  
  12. '[Writing values to textfile]
  13.  
  14. If cbx_OpenLogfile.Value = True Then
  15.  
  16. Retry:
  17. If ItIsARetry Then On Error Resume Next Else On Error GoTo TryAndClose
  18. Open WBpath & "checklog" & ".txt" For Input As #1
  19. On Error GoTo 0
  20.  
  21. Exit Sub
  22.  
  23. TryAndClose:
  24. Close #1
  25. ItIsARetry = True
  26. GoTo Retry
  27.  
  28. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement