hi everyone,
I want to build an application that open a window when a a new file is loaded into a folder.
I tried to do this using the following,(these functions are in a module)
Public Function FileExist(strPath As String) As Boolean
FileExist = Not (Dir(strPath) = ""
End Function
Public Function file_in_folder() As Boolean
Dim sFilePath As String
sFilePath = "c:\abcdef\"
If (FileExist(sFilePath & "*.*"
) Then
file_in_folder = True
Form1.Visible = True
Else
file_in_folder = False
End If
End Function
Now, i call to file_in_folder( ) function throught a "do while/ loop" procedure in order to wait until something happens inside the folder but i can´t achieve that the window appears when a file is loaded into the "abcdef" folder.
it always stay "waiting".
But if the file is in the folder before i run the appl. then when it runs the window is open.
then i put a msgbox inside function, like this
Public Function file_in_folder() As Boolean
Dim sFilePath As String
sFilePath = "c:\abcdef\"
If (FileExist(sFilePath & "*.*"
) Then
file_in_folder = True
msgbox "file in folder"
Form1.Visible = True
Else
file_in_folder = False
msgbox "file does not exist"
End If
End Function
and it works fine, but i don´t want this mesage.
Can anyone helpme with this?
I only want run the appl. when a file is inside a folder...
I want to build an application that open a window when a a new file is loaded into a folder.
I tried to do this using the following,(these functions are in a module)
Public Function FileExist(strPath As String) As Boolean
FileExist = Not (Dir(strPath) = ""

End Function
Public Function file_in_folder() As Boolean
Dim sFilePath As String
sFilePath = "c:\abcdef\"
If (FileExist(sFilePath & "*.*"

file_in_folder = True
Form1.Visible = True
Else
file_in_folder = False
End If
End Function
Now, i call to file_in_folder( ) function throught a "do while/ loop" procedure in order to wait until something happens inside the folder but i can´t achieve that the window appears when a file is loaded into the "abcdef" folder.
it always stay "waiting".
But if the file is in the folder before i run the appl. then when it runs the window is open.
then i put a msgbox inside function, like this
Public Function file_in_folder() As Boolean
Dim sFilePath As String
sFilePath = "c:\abcdef\"
If (FileExist(sFilePath & "*.*"

file_in_folder = True
msgbox "file in folder"
Form1.Visible = True
Else
file_in_folder = False
msgbox "file does not exist"
End If
End Function
and it works fine, but i don´t want this mesage.
Can anyone helpme with this?
I only want run the appl. when a file is inside a folder...