Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function FileLastModified(strFullFileName As String)
- Dim fs As Object, f As Object, s As String
- Set fs = CreateObject("Scripting.FileSystemObject")
- Set f = fs.GetFile(strFullFileName)
- s = UCase(strFullFileName) & vbCrLf
- s = s & "Last Modified: " & f.DateLastModified
- FileLastModified = s
- Set fs = Nothing: Set f = Nothing
- End Function
- Private Sub CommandButton1_Click()
- If CheckBox1.Value = True And CheckBox2.Value = True And CheckBox3.Value = True Then
- UserForm1.Hide
- Call Import_DB
- ElseIf CheckBox1.Value = True And CheckBox2.Value = False And CheckBox3.Value = False Then
- MsgBox ("Export Database and Log in")
- ElseIf CheckBox1.Value = False And CheckBox2.Value = True And CheckBox3.Value = False Then
- MsgBox ("Run Characteristics Version 1.2.xlsm and Export Database")
- ElseIf CheckBox1.Value = True And CheckBox2.Value = False And CheckBox3.Value = True Then
- MsgBox ("Log into SEI")
- ElseIf CheckBox1.Value = True And CheckBox2.Value = True And CheckBox3.Value = False Then
- MsgBox ("Export Database")
- ElseIf CheckBox1.Value = False And CheckBox2.Value = False And CheckBox3.Value = True Then
- MsgBox ("Run Characteristics Version 1.2.xlsm and Log in")
- Else
- MsgBox ("Export Database and Log in and Run Characteristics Version 1.2.xlsm")
- End If
- 'Unload UserForm1
- End Sub
- Private Sub UserForm_Initialize()
- Dim ExportQ As String
- Dim IndiaM As String
- Dim MyDate As String
- MyDate = Date
- InM = FileLastModified("P:")
- ExportQ = FileLastModified("P:")
- If InM = MyDate Then CheckBox1.Value = True
- If ExportQ = MyDate Then CheckBox3.Value = True
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement