-
I use th code below and it works fine on my pc because I have VB6 installed. When I make it into and exe and copy it and the msv60 file on another pc I get the error.."Active X cannot create object...of course this is the FSO object.
I don't want to make a full install..
How do I include the FSO or use another method to get the file last modified date?
API?
Thanks,
Wayne
'==========================================Sub Info(filespec)
Dim fs, f, s, ct
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(filespec)
s = f.datelastmodified
If Format(s, "yyyy,mm,dd") <> Format(Date, "yyyy,mm,dd") Then
sendmsg = "DoIt"
List1.AddItem "Problem #" & (iFiles + 1) & ":"
List1.AddItem filespec & ": has not been modified today!"
List1.AddItem "The last time modification was " & s
List1.AddItem ""
List1.AddItem "________________________________________________"
List1.AddItem ""
Else
List1.AddItem (iFiles + 1) & " " & "Processed OK"
List1.AddItem ""
List1.AddItem "________________________________________________"
List1.AddItem ""
End If
End Sub
Private Sub Form_Load()
'count files in a directory
Dim sDir As String
sDir = Dir("j:\*.dat", vbNormal)
While sDir <> ""
MyCollection.Add sDir
Call Info("j:\" & MyCollection(iFiles + 1))
iFiles = iFiles + 1
sDir = Dir
Wend
DoEvents
Dim msg$
If sendmsg = "DoIt" Then
msg = "The IVR Move needs to be rerun." & vbCrLf
MsgBox msg
Else
msg = "All's Well..No Problems!"
End If
End Sub
-
You have to include scrrun.dll with your EXE as well.
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
-
If all you're after is the Creation/Last Modified Date/Time, use the VB Function FileDateTime()
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Thank you both...one goes in the notes..the other gets applied for future reference.
Wayne
-
or use
Code:
'This is the modified date
varFileDateTime = FileDateTime(strDirPath & SYSFILE)