Microsoft KB Archive/98283

{|
 * width="100%"|

PRJ: EditInsertObject Needs Extra Time to Execute

 * }

Q98283

-

The information in this article applies to:


 * Microsoft Project for Windows, versions 3.0, 3.0a, 4.0

-

SYMPTOMS
The EditInsertObject macro command, available in Microsoft Project for Windows, may take more time to execute than other similar macro commands.

WORKAROUND
To work around this problem, add the following lines to the Microsoft Excel Macro and run this macro first. These lines contain the ON.TIME macro function which will create a lag time sufficient to allow Microsoft Excel to execute the EditInsertObject command:

  =ON.TIME(NOW+&quot;00:00:10&quot;,&quot;TEST&quot;) =RETURN In this workaround, a new defined name is given to the original Microsoft Excel macro. The first Microsoft Excel macro, &quot;MACRO1&quot;, is redefined as &quot;TEST&quot; and the macro with the ON.TIME function is defined as &quot;MACRO1&quot;. The EditInsertObject macro in Microsoft Project will call the ON.TIME macro, &quot;MACRO1&quot;, and allow Microsoft Excel time to create the object worksheet. After 10 seconds have elapsed the ON.TIME macro will start the &quot;TEST&quot; macro and add the text &quot;test&quot;.

MORE INFORMATION
Since the EditInsertObject command takes time to complete, it may interfere with the commands that come after it.

The following macro will activate Microsoft Excel, open a Microsoft Excel worksheet called &quot;Worksheet in &quot;, and run a Microsoft Excel macro that attempts to place information on the object worksheet. Since the Microsoft Excel macro is executed before the object worksheet is created, however, the information is placed on the macro sheet instead of the object worksheet.

  EditInsertObject .Name=[Microsoft Excel Worksheet] DDEInitiate .Application=[Excel] .Topic=[c:\excel\macro1.xlm] DDEExecute .Command=RUN(&quot;MACRO1.XLM!MACRO1&quot;) .TimeOut=[2] DDETerminate The following Microsoft Excel macro assumes that Microsoft Excel is running, the file is named &quot;Macro1.xlm&quot;, and the file is open:

  =SELECT(&quot;r[6]c&quot;)+FORMULA(&quot;test&quot;) =RETURN The above Microsoft Excel macro has been defined with the name of &quot;MACRO1&quot;. When this macro is executed, it will select the sixth row of MACRO1.XLM and place the word &quot;test&quot; in the active cell.

Additional query words: 4.0 3.00a

Keywords : kbcode

Issue type : kbprb

Technology : kbProjectSearch kbProject300 kbProject300a kbProject400