Consulting

Results 1 to 3 of 3

Thread: VBA file save slow problem

  1. #1
    VBAX Newbie
    Joined
    Dec 2017
    Posts
    2
    Location

    VBA file save slow problem

    So I’m trying to write an application that writes text files very fast. These files are processed by autohotkey after they are written and their order is important.

    Windows is writing files out of time sequence order and I’m assuming it’s some sort of write caching issue.

    For example if I write 10 separate text files in five seconds they may not actually be written in chronological order to the disk. For example the fifth one might be actually say before the fourth one etc. it’s not consistent. They are not written that way from VBA however it is strictly a Windows OS issue. I’m looking for some ideas on how to combat that.

  2. #2
    VBAX Tutor
    Joined
    Mar 2014
    Posts
    210
    Location
    they do save in the order you save them.
    workbooks("A").save
    workbooks("B").save

    workbook B will NOT save until A is finished

  3. #3
    VBAX Newbie
    Joined
    Dec 2017
    Posts
    2
    Location
    Quote Originally Posted by ranman256 View Post
    they do save in the order you save them.
    workbooks("A").save
    workbooks("B").save

    workbook B will NOT save until A is finished
    Thank you. The problem seems to be that I’m trying to sort by date time and fractions of a second are important however the system doesn’t return them when you pull file properties.

    My solution was to simply delete the file the instant it’s processed and that seems to make a huge difference.

    When overwriting it there would be no perceivable difference to my routine if the change happened within a second of the last change. So if I deletd it I ensure that I’m always getting the new file .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •