Cut and Paste in MAPPOINT
Posted on 2003-11-05
I am controlling Microsoft Mappoint and Powerpoint from VBA in Excel. The program opens mappoint, does a dataset copy and then pastes it into powerpoint (to get the legend).
This works most of the time. However, about 5% of the time, randomly, the copy operation fails and the subsequent paste operation actually pastes the previous contents of the clipboard. It never fails in the same place and most of the time it doesn't fail at all.
This leads me to speculate that the copy operation, in mappoint, is being performed asynchronously and thus my program gets control and initiates the paste before it completes.
Does anybody have a solution for this? Is there anyway I can test the clipboard to see whether or not an operation is completed? I've tried adding delays in the program and loops with doevents, but that seems to make the problem worse.