Filesystemobject.DateCreated returns error 5 - invalid procedure call

Posted on 2005-04-12
Last Modified: 2008-02-01

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

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?


Mike Salonin
    LVL 7

    Accepted Solution

    check the version of scrrun.dll on the development machine versus the machine where your having an issue.  If they're different then there's your answer.

    Author Comment

    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

    LVL 7

    Expert Comment

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

    Good luck,

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
    You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now