Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think it was the combination of doEvents and releasing the shiftkey.
Andy wrote: Hi Tony Your first suggestion works!!! In fact I only needed to add DoEvents before opening the workbook. Out of interest I tried error trapping but that didn't work. Thank you all sooooo much for your help and for maintaining my sanity! Andy "tony h" wrote: two suggestions 1. try using a doevents just before and after your troublesome line. The doEvents statement tell excel to stop doing what it is doing and let other processes have a go. It maybe that your breakpoint is just releasing the process and that the doevents would do the same thing. 2. Put an error trap around the code. depending on how the code was activated an error may just halt the code. It is particularly important to do this in user defined functions and dependant code that is called from the worksheet. Sub mycode() Dim str As String On Error GoTo AnError 'my code ........... str = 1 / 0 GoTo TheEnd AnError: MsgBox "error : " & Err.Number & " " & Err.Description Stop 'you will have to decide what to do here TheEnd: End Sub hope this helps -- tony h ------------------------------------------------------------------------ tony h's Profile: http://www.excelforum.com/member.php...o&userid=21074 View this thread: http://www.excelforum.com/showthread...hreadid=392442 -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Bizarre XLA behaviour | Excel Discussion (Misc queries) | |||
Bizarre Excel 03 Problem - autosum not updating when cells are cha | Excel Worksheet Functions | |||
Bizarre MS EXCEL problem - files will not open via document ICONs | Excel Discussion (Misc queries) | |||
Bizarre Project Explorer in VBE | Excel Programming | |||
Bizarre and frustrating bug | Excel Programming |