none
Slow form loading on some computers RRS feed

  • Question

  • We have several VBA projects which make extensive use of forms. They run perfectly well on most  of our PCs but forms are very slow to load on just one of the PCs.

    Each user has their own copy of each project. The projects are guaranteed to be identical on each workstation as they are copied from the server each day when the user logs in.

    All the PCs are of very similar spec (i.e. processor speed, graphics card, ram etc).

    My question is

    Why are forms slow to load on just one of our PCs?

    Is there some setting which needs changing on the "slow" PC?

    Wednesday, June 12, 2013 9:01 AM

Answers

  • Having found a work around we are replying to our own question in case it helps others.

    We traced the problem to the "Load" event.

    "myform.show" triggers the load event and the activate event.

    As the form is used repetitively we changed "unload me" to "myform.hide" and moved some code from the initialise sub in the form to the activate sub.

    The first use of the form is still slow but subsequent uses are quick. This is because, using the above technique, the form remains in memory and so the "load" event happens on the first use of the form but not on subsequent uses.

    We speculate that the "load" event is slow because it activates the hard drive on the offending computer, whereas the "Activate" event does not. The drive on the troublesome computer has a seek time which is about 50% longer than the other computers.

    Does anyone know why the "Load" event activates the hard drive given that the form does not look at a database nor does it open any external files?

    Monday, July 22, 2013 12:51 PM

All replies

  • So if you create a new VBA project loading user forms in the "slow" PC, will it be slow again?

    Is there any connection in your project to database?

    Monday, June 17, 2013 5:50 AM
  • Thanks for your reply.

    I re-made the form in a new project on the "slow" PC and it made no difference.

    The form does not look at any external files, nor does it access a database file. However, we hear the hard drive searching while the file is loading. Could it be using a scratch disc?

    Tuesday, June 18, 2013 12:24 PM
  • Having found a work around we are replying to our own question in case it helps others.

    We traced the problem to the "Load" event.

    "myform.show" triggers the load event and the activate event.

    As the form is used repetitively we changed "unload me" to "myform.hide" and moved some code from the initialise sub in the form to the activate sub.

    The first use of the form is still slow but subsequent uses are quick. This is because, using the above technique, the form remains in memory and so the "load" event happens on the first use of the form but not on subsequent uses.

    We speculate that the "load" event is slow because it activates the hard drive on the offending computer, whereas the "Activate" event does not. The drive on the troublesome computer has a seek time which is about 50% longer than the other computers.

    Does anyone know why the "Load" event activates the hard drive given that the form does not look at a database nor does it open any external files?

    Monday, July 22, 2013 12:51 PM