Speed of how the Macro plays back

can you control the seepd of the play back that you make with a macro?

Reply to
Arthur Y-S
Loading thread data ...

maybe you want it to run faster ;-) there are ways, especially when sketching (see ModelDoc2::SetAddToDB) why would you want it to run slower ? If you feel that something goes wrong because it runs too fast, you're certainly wrong. The fact that the display is regenerated asynchroneously with the API calls is sometimes misleading. anyway, use the debug buttons for debugging and Timers at run-time.

Reply to
Philippe Guglielmetti

I am asking for it to run slower because I would like to show an example of how to create something in the program. This is being shown to ppl that have not seen the program before, so if the speed is too fast they will miss out on some of the key points.

Reply to
Arthur Y-S

What about having it step through on a keypress? That way they or you could proceed at the desired pace.

WT

Reply to
Wayne Tiffany

This can be done by adding Excel to your References. Then add this line with whatever value you want for the time.

Excel.Application.Wait (Now + TimeValue("0:00:01"))

this will pause for One second. I Know it will make atleast Excel inacessable, I also have noticed it takes up some of your resourses while it is paused somewhere between 10 and 50 percent. I have used this for a makeshift Notification watch because the application i was waiting for has no VBA accessible calls.

"FOR I BELIEVE THAT ANY CALL NOMATER HOW SILLY IT SOUNDS HAS A USE TO SOMEONE, EVEN IF YOU CAN'T THINK OF ANY INSTANCE YOURSELF." - Corey Scheich LOL I laugh at my self, how lonely does that sound.

Reply to
Corey Scheich

You could also just throw in a large for:next loop where you want to pause. Like:

for t = 1 to 100000 next t

Reply to
Arlin

The following example shows a simple sub for waiting a specific time... Just call the sub and guess a proper value for the parameter. This is a better way than using a for loop, since you can use a specific value to determine the delay.

Sub Pause(lngTime as Long) Dim lngStart As Long lngStart = Now() 'Store current time While (Now() - lngStart) < lngTime 'Keep on comparing until time has elapsed Wend End Sub

-h-

Reply to
Heikki Leivo

I can assign each macro to a different key? or am I playing one Macro after the other?

Reply to
Arthur Y-S

"Corey Scheich" wrote in news:bh89qv$uov06$ snipped-for-privacy@ID-200385.news.uni-berlin.de:

Kinda bulky adding a reference to Excel just for its Wait function.

Add this to the macro:

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Wherever you want to pause:

Sleep(1000) ' Sleep for 1 second

Reply to
Joel Moore

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.