VBA to simulate enter key selection

glad_ir

Board Regular
Joined
Nov 22, 2020
Messages
146
Office Version
  1. 2010
Platform
  1. Windows
Hi,

Please can I get some help with this one?

I am using the code below in a PowerPoint deck to run a countdown timer when rectangle 7 is clicked on a slide. I would like to modify the code to trigger an animated shape to appear (by simulating the "enter" key being pressed?).

VBA Code:
Sub macroSTRAT()

Dim time As Date
time = Now()

Dim count As Integer
count = 90

time = DateAdd("s", count, time)

Do Until time < Now()
DoEvents
ActivePresentation.SlideShowWindow.View.Slide.Shapes("Rectangle 7").TextFrame.TextRange = Format((time - Now()), "nn:ss")
Loop

CreateObject("Shell.Application").ShellExecute "wmplayer.exe", "m:\FBI.mp3", , "open", 0

End Sub

Any help much appreciated!

Thank you, Iain
 
Last edited:

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
trigger an animated shape to appear (by simulating the "enter" key being pressed?).
I don't get it. Maybe you want to use SendKeys to replicate Enter key press? Not sure why you would code a key press to show a shape when you can just code to show the shape.
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top