Home Software Tutorial Office Software What's wrong with the PPT countdown VBA code?

What's wrong with the PPT countdown VBA code?

Jan 07, 2024 pm 09:02 PM
ppt answer countdown macro What's wrong with the ppt countdown vba code How to set countdown time on ppt

What’s wrong with the PPT countdown VBA code

Changed in two places

The first line has been changed for you

In order to help players who have not passed the level yet, let us learn about the specific puzzle solving methods. In addition, another little trick is to add a shape(1) after ActivePresentation.Slides(1). This operation can help you solve the puzzle faster, so remember to try it.

Test possible

In order to help players who have not passed the level yet, let us learn about the specific puzzle solving methods. At the same time, we can use the SetTimer function to set the timer, which is located in the user32 library. This function accepts four parameters: window handle (hwnd), timer ID (nIDEvent), interval time (uElapse) and timer callback function (lpTimerFunc). By calling this function, we can perform specific operations within a certain time interval.

Sub Timer()

To help players solve the problem, we can use the following code to calculate the difference in seconds between the current time and the specified date: `ss = DateDiff("s", Now, "2012-3-22 00:00:00 ")`. This code will return an integer value representing the number of seconds between the current time and the specified date.

dd = ss \ 86400

hh = (ss Mod 86400) \ 3600

mm = (ss Mod 3600) \ 60

ss = ss Mod 60

ActivePresentation.Slides(1).Shapes(1).TextFrame.TextRange.Text = "There are still days before the 2012 exam" & vbCrLf & dd & "days" & hh & "hours" & mm & "minutes" & ss & "second"

End Sub

Sub Start()

ActivePresentation.SlideShowSettings.Run

SetTimer 0, 0, 1000, AddressOf Timer

End Sub

How to set the countdown time on PPT

1. Open PPT, select "Insert" - "Shape" - "Circle" (hold down the shift key while drawing a circle).

PPT倒数计时 VBA代码哪里错了

2. Set the fill background color and border of the drawn circle (select the circle, right-click and select "Format Shape", or directly use the "Fill" and "Outline" functions to set it.), and then fill in the circle number.

PPT倒数计时 VBA代码哪里错了

PPT倒数计时 VBA代码哪里错了

3. Set animation, select the drawn shape (combine circles and numbers) - select animation - add animation - select the entry animation as "appear" - select the exit animation as "disappear". Then set the "Start" option to "After Previous Animation" and the delay time to 0.5 seconds.

PPT倒数计时 VBA代码哪里错了

PPT倒数计时 VBA代码哪里错了

4. Then copy the drawn shape, paste 4 identical circles (their animation properties are also copied and pasted at the same time), and change the numbers in the circles to 4, 3, 2, and 1.

PPT倒数计时 VBA代码哪里错了

5. Set the format of five numbers. Select the five shapes and select "Center Left and Right" and "Center Top and Bottom" under "Format" - "Alignment".

PPT倒数计时 VBA代码哪里错了

6. After completing the above steps, the five shapes are "combined into one", and then select the play button to view the dynamic countdown effect from 5-1.

PPT倒数计时 VBA代码哪里错了

The above is the detailed content of What's wrong with the PPT countdown VBA code?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Your Calculator App Can Be Replaced By Microsoft Excel Your Calculator App Can Be Replaced By Microsoft Excel Mar 06, 2025 am 06:01 AM

Your Calculator App Can Be Replaced By Microsoft Excel

Don't Create Tables in Word: Use Excel Instead Don't Create Tables in Word: Use Excel Instead Mar 06, 2025 am 03:04 AM

Don't Create Tables in Word: Use Excel Instead

How to Reduce the Gaps Between Bars and Columns in Excel Charts (And Why You Should) How to Reduce the Gaps Between Bars and Columns in Excel Charts (And Why You Should) Mar 08, 2025 am 03:01 AM

How to Reduce the Gaps Between Bars and Columns in Excel Charts (And Why You Should)

How to Use the AVERAGEIF and AVERAGEIFS Functions in Excel How to Use the AVERAGEIF and AVERAGEIFS Functions in Excel Mar 07, 2025 am 06:03 AM

How to Use the AVERAGEIF and AVERAGEIFS Functions in Excel

Microsoft Excel Keyboard Shortcuts: Printable Cheat Sheet Microsoft Excel Keyboard Shortcuts: Printable Cheat Sheet Mar 14, 2025 am 12:06 AM

Microsoft Excel Keyboard Shortcuts: Printable Cheat Sheet

How to Use LAMBDA in Excel to Create Your Own Functions How to Use LAMBDA in Excel to Create Your Own Functions Mar 21, 2025 am 03:08 AM

How to Use LAMBDA in Excel to Create Your Own Functions

5 Things You Can Do in Excel for the Web Today That You Couldn't 12 Months Ago 5 Things You Can Do in Excel for the Web Today That You Couldn't 12 Months Ago Mar 22, 2025 am 03:03 AM

5 Things You Can Do in Excel for the Web Today That You Couldn't 12 Months Ago

If You Don't Use Excel's Hidden Camera Tool, You're Missing a Trick If You Don't Use Excel's Hidden Camera Tool, You're Missing a Trick Mar 25, 2025 am 02:48 AM

If You Don't Use Excel's Hidden Camera Tool, You're Missing a Trick

See all articles