How do I debug a message if another message prevents me from doing so ?!?

vodkasoda

Board Regular
Joined
Aug 12, 2004
Messages
86
OK, a vague enough question I am sure, but this is my predicament :

If I run my VBA program I get an error message "Argument Not Optional" ... but if I debug I get the message "Can't execute code in break mode" !!

My main VBA is in Thisworkbook and the new code is as follows :

Code:
    Range("B11").Activate
    
    Set myRange1 = Range("B" & (10 + mySession))
    Set myRange2 = Range("H" & (10 + mySession))
    
    If myRange1 = "" Then
        Call StartBlink(myRange2)
    End If
        
    Application.ScreenUpdating = True

The Module Blinking_Text contains the following code (this is adapted from code I have found online, I am not sure what this RunWhen stuff does) :

Code:
Option Explicit
Public RunWhen As Double
 
Sub StartBlink(BlinkCell As Range)
    
    If BlinkCell.Font.ColorIndex = 1 Then
        BlinkCell.Font.ColorIndex = 2
    Else
        BlinkCell.Font.ColorIndex = 1
    End If
    
    RunWhen = Now + TimeSerial(0, 0, 1)
    
    Application.OnTime RunWhen, "StartBlink", , True
    
End Sub
 
Sub StopBlink(BlinkCell As Range)

    BlinkCell.Font.ColorIndex = xlAutomatic
    
    Application.OnTime RunWhen, "StartBlink", , False
    
End Sub

Any ideas ?
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Forum statistics

Threads
1,214,835
Messages
6,121,880
Members
449,057
Latest member
Moo4247

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