PDA

Click to See Complete Forum and Search --> : Walk Around This? FSO


HeSaidJoe
Dec 12th, 1999, 07:43 PM
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

Serge
Dec 12th, 1999, 07:58 PM
You have to include scrrun.dll with your EXE as well.

------------------

Serge

Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)

Aaron Young
Dec 12th, 1999, 08:16 PM
If all you're after is the Creation/Last Modified Date/Time, use the VB Function FileDateTime()

------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
adyoung@win.bright.net

HeSaidJoe
Dec 12th, 1999, 08:24 PM
Thank you both...one goes in the notes..the other gets applied for future reference.
Wayne

jesus4u
Dec 18th, 2002, 08:34 AM
or use


'This is the modified date
varFileDateTime = FileDateTime(strDirPath & SYSFILE)