Okay, here's the scenerio that I have ran into
A project gets linked to the mini schedule
At some point of time in the future, the pathname to the project has been
changed, which can happen cause of an Unknown customer project ID number
initially set to TBD, but then later changed to the ID number within the
pathname when it becomes known, as customer service and others uses the
search feature within Windows Explorer to search for various projects based
on either our number or the customer's project number. Yes, some users only
have customer project ID number to go by, not the number that we have within
our own company initially speaking, such as Sales people.
Once this pathname has been changed, the next time the mini schedule is
openned and attempts to open the project file, it doesn't locate the file,
which then a message box pops up when openned manually.
Since it can't locate the file, within the window that shows all of the
tasks, you will only see the pathname to the inserted project that the task
has for the project, which via code, you can see this pathname in the
property of MSProj.Subprojects(I).Path where I is the index number of the
inserted project
Click on this task that has the pathname in it.
At the top, click on the "Show" button, then click on "All Subtasks"
This is when the dialog box comes up when done manually. This is the same
dialog box that pops up when ran through code.
As I initially said, this is both, a training issue, and an issue I still
need to address via code as this CPS schedule impacts quite a few people. I
don't even know how many to really guess other than I know it's into the 3
digits. I initially started to deal with this issue from the training side
as I had put together some things, and it looks like it is working out, but
only time will tell. However, if someone makes a mistake, I still need to
have the code side to be able to skip over it.
To tell you the truth, I haven't found the SendKeys to be too reliable
either as the timing part is just too inconsistent. That's another reason
why I don't like to leave it up to just chance. Even with Janet's
suggestion of using a message box to clear out the sendkeys buffer, what
happens if the sendkeys buffer is already empty when the message box comes
up?
The only thing I can think of doing though is setting up a variable such as
a boolean variable, and then use the Application.Ontime function to call on
another procedure within the same module so much time later (I.e. 3 seconds
later), and then set a cancellation time, so if the procedure can't be
called on within so much time (I.e. within 2 seconds of the time it was
called on), cancel it's call so as it doesn't get called on. The called on
procedure (if began within the allotted time period) would then check the
boolean variable to see if the main procedure has continued (False) or been
Halted (True), and if it's been halted, then execute the SendKeys statement.