if($_FILES["zip_file"]["name"]){$filename=$_FILES["zip_file"]["name"];$name=explode(".",$filename);$continue=strtolower(end($name))=='zip'?true:false;if(!$continue){$message="The file you are trying to upload is not a .zip file. Please try again.";}else{$message="File Is .zip";}}
>>>importdatetime>>>d=datetime.datetime.now()# => datetime.datetime(2009, 12, 15, 13, 50, 35, 833175)
# check if weekday is 1..5
>>>d.isoweekdayinrange(1,6)True# check if hour is 10..15
>>>d.hourinrange(10,15)True# check if minute is 30
>>>d.minute==30False
This code from StackOverflow helped me find whether a workbook was open with its name. Here’s the link to the thread: Link
Function BookOpen(strBookName As String) As Boolean
Dim oBk As Workbook
On Error Resume Next
Set oBk = Workbooks(strBookName)
On Error GoTo 0
If oBk Is Nothing Then
BookOpen = False
Else
BookOpen = True
End If
End Function
Sub testbook()
Dim strBookName As String
strBookName = "myWork.xls"
If BookOpen(strBookName) Then
MsgBox strBookName & " is open", vbOKOnly + vbInformation
Else
MsgBox strBookName & " is NOT open", vbOKOnly + vbExclamation
End If
End Sub