Link to home
Start Free TrialLog in
Avatar of PHOTOSONTHESPOT
PHOTOSONTHESPOTFlag for Canada

asked on

Filesystemobject.DateCreated returns error 5 - invalid procedure call

Hi.

Here's a strange item that I can't seem to solve.

My very stable vb code which has been running for many years (vb6 sp6) includes a reference to the
filesystemobject.datecreated
property.

All of a sudden, I am getting error 5 - invalid procedure call even though the filename used when making the call is valid.
If I replace datecreated with datelastmodified, everything works fine (but I don't want the last modified date, I want the creation date)
I should also point out that this 'issue' only happens on some of the workstations but never on the development machine

any ideas?

Sample code


(everything dimensioned correctly)

set fso2= new filesystemobject
Set f = fso2.GetFile(validfilename)
msgbox f..datecreated


The 'validfilename' refers to  a valid file stored on a DVDROM .

The DVD was created by a client.  This code will execute correctly on my development system, but on a workstation that contains the compiled code only, it bombs.
This just started happending today.

Any ideas?

Thanks

Mike Salonin
ASKER CERTIFIED SOLUTION
Avatar of Steve Sirica
Steve Sirica
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PHOTOSONTHESPOT

ASKER

Thanks for answering.  The scrrun.dll versions are identical on all machines.

However, I did notice that the machines having problems have a lot of files on the hard drive (in excess of 500,000) (of course not in the root directory).  Doing a cleanup seems to have cleared up the problem but I'm not sure how this is related since the filesystemobject is looking at files on a DVDROM drive when the error occurs.

Mike Salonin

Glad to hear you solved the problem.  Sorry my suggestion didn't steer you in the right direction.

Good luck,
Steve