0
私はpowerpointでカウントダウンタイマーを作成しており、kernel32 sleep API(ppt内)を利用しています。 タイマーを長時間実行した後にスライドショーモードを終了すると(マクロを実行したままにしておくと)、私のWindowsデスクトップが完全に網状になり、完全に使用できなくなります(画面が奇妙な灰色になります)。デスクトップは時折戻ってきて再び動作を開始しますが、IEを開くと画面が再びすべてのスクリューになります。VB:Sleep API Issue
この問題の原因は何でしょうか?以下のタイマーコード
Do While (TMinus > -1)
'Suspend program execution for 1 second (1000 milliseconds)
Sleep 1000
'set hours, muinutes and seconds left based on number of seconds left (TMinus)
cHour = Int(TMinus/3600)
cMin = Int((TMinus Mod 3600)/60)
cSec = Int((TMinus Mod 3600) Mod 60)
'Change text in Shape 1 (timer) to reflect changed time
.TextFrame.TextRange.Text = Format(TimeSerial(cHour, cMin, cSec), "hh:mm:ss")
'decrement the countdown
TMinus = TMinus - 1
'Refreshes the display
DoEvents
Loop
'Sleep'は、マクロがスリープしている間に他のプロセスに制御を渡すので、' DoEvents'は必要ありません。 –