LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Code to kill all modal dialogs

I have the following code

Public TimerID1 As Long
Public TimerSeconds1 As Single

Sub StartTimer()
' Run the timer procedure every second
TimerSeconds1 = 1 ' how often to "pop" the timer.
TimerID1 = SetTimer(0&, 0&, TimerSeconds1 * 1000&, AddressOf TimerProc1)
End Sub

Sub TimerProc1(ByVal HWnd As Long, ByVal uMsg As Long, _
ByVal nIDEvent As Long, ByVal dwTimer As Long)

Call CountUp

End Sub

Sub CountUp()

ThisWorkbook.Sheets("Sheet1").Activate

Range("B5").Select
Selection.Value = Selection.Value + 1

End Sub

While the code runs if I try to bring any modal dialog (E.g. File -- Saves
As or attempt to refresh a PivotTable on the same workseet), Excel crashes!

What I want to do is to execute some code to kill any modal dialogs before I
execute the code inside the StartTime sub. Any sample code for this?

Thanks in advance
Michael


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to kill the zipped files in C:\Document and Settings\LogginName\Temp\ using code for this strange Problem Yuvraj Excel Discussion (Misc queries) 2 May 2nd 09 06:52 PM
Looking for sample code that would allow me to kill any modal dialog present in Excel Michael[_44_] Excel Programming 0 May 23rd 07 11:50 PM
Kill a process - Could someone check this code for me ina Excel Programming 2 May 10th 06 02:04 PM
Forms that are modal in 97 are not modal in 2003 Old Car Excel Discussion (Misc queries) 1 April 27th 05 08:25 AM
Forms that are modal in 97 are not modal in 2003 Old Car Excel Programming 1 April 27th 05 08:25 AM


All times are GMT +1. The time now is 06:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"