We help IT Professionals succeed at work.

Need to preserve a files last access and modified date/time using VB6

nealgs asked
Medium Priority
Last Modified: 2008-01-09
Hi all,

I need to be able to open word and excel docs from a VB6 app, but once finished with the docs, the last access and last modified dates/times need to be reset to what they were before they were opened by the application.

This used to be easy in DOS/Win16 days but everytime i attempt to retrieve a files last accessed date, the last accessed data is changed to the current time (as in the file has just been opened to retrieve the last accessed info, so the system updates the last accessed info on the file)

How on earth do you do it.  I'm using createfile etc without any luck.

The app will be used on 100's of word/excel docs so need to keep date/times.

Watch Question

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts


Hi Computron - thanks for the pointers, but already been there and tried them.

Didn't appear to work as last accessed date was still getting changed, but will try them again.


Wonder if this works (and hopefully it's not a duplicate of the above)...

Description: Set a file's creation, last access, and last modified times

From what I know about windows explorer for windows 98, they set the last accessed date as the current system date whenever you view the file properties.  At least that was my old PC... FYI

That's it!

glass cookie =)
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.