VBA script run from within Project Pro times out first time user runsit, then seems to run OK

A

andy.novak

Anyone know the cause of this and what I might be able to do to
prevent it?

Thanks,
Andy Novak
UNT
 
J

John

Anyone know the cause of this and what I might be able to do to
prevent it?

Thanks,
Andy Novak
UNT

Andy,
It looks like you've tried to put to much information in the subject
line because in my newsreader it is cut off so I can't tell what you are
talking about.

What do you mean, "times out"? What is the macro supposed to do? What is
your end goal?

John
Project MVP
 
A

andy.novak

Andy,
It looks like you've tried to put to much information in the subject
line because in my newsreader it is cut off so I can't tell what you are
talking about.

What do you mean, "times out"? What is the macro supposed to do? What is
your end goal?

John
Project MVP

It queries information from the reporting database tables, provides
the user with a dialog box from which to pick certain values, then
creates a project for them based on the values selected.
The code is fine in terms of what it does. There are times when I run
it the first time on a new machine, I wait at least a minute and
receive a timeout error. But when I immediately run it again from
then on after, it is fine. Happens with more than one macro that I've
written.
 
J

John

It queries information from the reporting database tables, provides
the user with a dialog box from which to pick certain values, then
creates a project for them based on the values selected.
The code is fine in terms of what it does. There are times when I run
it the first time on a new machine, I wait at least a minute and
receive a timeout error. But when I immediately run it again from
then on after, it is fine. Happens with more than one macro that I've
written.

Andy,
When you say the "reporting database tables", are you referring to
Project's underlying database or some other database (e.g. Access)? If
it is the latter, I might suspect code to establish the link to the
database recordset is not getting set up initially.

You might also want to check that all the necessary references are set
for whatever object libraries you need.

Is there any error message when it times out?

This may be a cheap shot, but as a workaround, if you can't find a
definitive cause, try setting a precursor link to the database with a
controlled error routine using the "On Error Resume Next" code
structure. That should get you around the first run try.

John
Project MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top