Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. Function FileLastModified(strFullFileName As String)
  2. Dim fs As Object, f As Object, s As String
  3. Set fs = CreateObject("Scripting.FileSystemObject")
  4. Set f = fs.GetFile(strFullFileName)
  5.  
  6. s = UCase(strFullFileName) & vbCrLf
  7. s = s & "Last Modified: " & f.DateLastModified
  8. FileLastModified = s
  9.  
  10. Set fs = Nothing: Set f = Nothing
  11.  
  12. End Function
  13.  
  14. Private Sub CommandButton1_Click()
  15. If CheckBox1.Value = True And CheckBox2.Value = True And CheckBox3.Value = True Then
  16. UserForm1.Hide
  17. Call Import_DB
  18. ElseIf CheckBox1.Value = True And CheckBox2.Value = False And CheckBox3.Value = False Then
  19. MsgBox ("Export Database and Log in")
  20. ElseIf CheckBox1.Value = False And CheckBox2.Value = True And CheckBox3.Value = False Then
  21. MsgBox ("Run Characteristics Version 1.2.xlsm and Export Database")
  22. ElseIf CheckBox1.Value = True And CheckBox2.Value = False And CheckBox3.Value = True Then
  23. MsgBox ("Log into SEI")
  24. ElseIf CheckBox1.Value = True And CheckBox2.Value = True And CheckBox3.Value = False Then
  25. MsgBox ("Export Database")
  26. ElseIf CheckBox1.Value = False And CheckBox2.Value = False And CheckBox3.Value = True Then
  27. MsgBox ("Run Characteristics Version 1.2.xlsm and Log in")
  28. Else
  29. MsgBox ("Export Database and Log in and Run Characteristics Version 1.2.xlsm")
  30. End If
  31.  
  32. 'Unload UserForm1
  33.  
  34. End Sub
  35.  
  36. Private Sub UserForm_Initialize()
  37.  
  38. Dim ExportQ As String
  39. Dim IndiaM As String
  40. Dim MyDate As String
  41. MyDate = Date
  42. InM = FileLastModified("P:")
  43. ExportQ = FileLastModified("P:")
  44. If InM = MyDate Then CheckBox1.Value = True
  45. If ExportQ = MyDate Then CheckBox3.Value = True
  46. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement