PC Review


Reply
Thread Tools Rate Thread

Blinking TEXT - Help needed

 
 
naeem.mahmood@gmail.com
Guest
Posts: n/a
 
      3rd Apr 2007
Hello

I found the following blinking text code via this forum.


------------------------------------------------
' First, you need to set up a procedure to cause the text to
alternate
between white and black.
' Put the following code in a regular code module:
Private RunWhen As Double


Sub StartBlink()
If Range("Blink").Font.ColorIndex = 2 Then
Range("Blink").Font.ColorIndex = xlColorIndexAutomatic
Else
Range("Blink").Font.ColorIndex = 2
End If
RunWhen = Now + TimeSerial(0, 0, 1)
Application.OnTime RunWhen, "StartBlink", , True
End Sub


Sub StopBlink()
Range("Blink").Font.ColorIndex = xlColorIndexAutomatic
Application.OnTime RunWhen, "StartBlink", , False
End Sub


' In both these procedures, change the reference to A1 to the cell
that should blink.


' When the workbook is closed, you need to cancel OnTime event
triggers,
' so put the following code in the ThisWorkbook code module.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
StopBlink
End Sub


' You need to initiate this procedure when the workbook opens, so put
the following code
' in the ThisWorkbook code module:
Private Sub Workbook_Open()
StartBlink
End Sub
---------------------------------------------------------


Its working fine as long as no other excel file is not open. As soon
as I open anything else following error open.


"Run-time erroe '1004': Method 'Range' of object'_Global failed."


Could anyone please help as I want to use this code while other files
are open.

Upon receving comments from the group I adjusted the code to reflect
the specific workbook.

Thanks for the reply.

I tried putting that code in as follows.
----------------------------------------------------------------------
Sub StartBlink()
If
Workbooks("DailyBalance").Sheets("Main").Range("Blink").Font.ColorIndex
= 2 Then


Workbooks("DailyBalance").Sheets("Main").Range("Blink").Font.ColorIndex
= xlColorIndexAutomatic
Else


Workbooks("DailyBalance").Sheets("Main").Range("Blink").Font.ColorIndex
= 2
End If
RunWhen = Now + TimeSerial(0, 0, 1)
Application.OnTime RunWhen, "StartBlink", , True
End Sub
---------------------------------------------------------------------


But when I re-open the file following error comes up.


"Subscript Out of range"


Any HELP?


Thanks, Naeem

 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      3rd Apr 2007
try putting the .xls on the end of the file name

Workbooks("DailyBalance.xls").Sheets("Main").Range("Blink").

--
Regards,
Tom Ogilvy

"(E-Mail Removed)" wrote:

> Hello
>
> I found the following blinking text code via this forum.
>
>
> ------------------------------------------------
> ' First, you need to set up a procedure to cause the text to
> alternate
> between white and black.
> ' Put the following code in a regular code module:
> Private RunWhen As Double
>
>
> Sub StartBlink()
> If Range("Blink").Font.ColorIndex = 2 Then
> Range("Blink").Font.ColorIndex = xlColorIndexAutomatic
> Else
> Range("Blink").Font.ColorIndex = 2
> End If
> RunWhen = Now + TimeSerial(0, 0, 1)
> Application.OnTime RunWhen, "StartBlink", , True
> End Sub
>
>
> Sub StopBlink()
> Range("Blink").Font.ColorIndex = xlColorIndexAutomatic
> Application.OnTime RunWhen, "StartBlink", , False
> End Sub
>
>
> ' In both these procedures, change the reference to A1 to the cell
> that should blink.
>
>
> ' When the workbook is closed, you need to cancel OnTime event
> triggers,
> ' so put the following code in the ThisWorkbook code module.
> Private Sub Workbook_BeforeClose(Cancel As Boolean)
> StopBlink
> End Sub
>
>
> ' You need to initiate this procedure when the workbook opens, so put
> the following code
> ' in the ThisWorkbook code module:
> Private Sub Workbook_Open()
> StartBlink
> End Sub
> ---------------------------------------------------------
>
>
> Its working fine as long as no other excel file is not open. As soon
> as I open anything else following error open.
>
>
> "Run-time erroe '1004': Method 'Range' of object'_Global failed."
>
>
> Could anyone please help as I want to use this code while other files
> are open.
>
> Upon receving comments from the group I adjusted the code to reflect
> the specific workbook.
>
> Thanks for the reply.
>
> I tried putting that code in as follows.
> ----------------------------------------------------------------------
> Sub StartBlink()
> If
> Workbooks("DailyBalance").Sheets("Main").Range("Blink").Font.ColorIndex
> = 2 Then
>
>
> Workbooks("DailyBalance").Sheets("Main").Range("Blink").Font.ColorIndex
> = xlColorIndexAutomatic
> Else
>
>
> Workbooks("DailyBalance").Sheets("Main").Range("Blink").Font.ColorIndex
> = 2
> End If
> RunWhen = Now + TimeSerial(0, 0, 1)
> Application.OnTime RunWhen, "StartBlink", , True
> End Sub
> ---------------------------------------------------------------------
>
>
> But when I re-open the file following error comes up.
>
>
> "Subscript Out of range"
>
>
> Any HELP?
>
>
> Thanks, Naeem
>
>

 
Reply With Quote
 
naeem.mahmood@gmail.com
Guest
Posts: n/a
 
      3rd Apr 2007
On Apr 3, 1:28 pm, Tom Ogilvy <TomOgi...@discussions.microsoft.com>
wrote:
> try putting the .xls on the end of the file name
>
> Workbooks("DailyBalance.xls").Sheets("Main").Range("Blink").
>
> --
> Regards,
> Tom Ogilvy
>
>
>
> "naeem.mahm...@gmail.com" wrote:
> > Hello

>
> > I found the following blinking text code via this forum.

>
> > ------------------------------------------------
> > ' First, you need to set up a procedure to cause the text to
> > alternate
> > between white and black.
> > ' Put the following code in a regular code module:
> > Private RunWhen As Double

>
> > Sub StartBlink()
> > If Range("Blink").Font.ColorIndex = 2 Then
> > Range("Blink").Font.ColorIndex = xlColorIndexAutomatic
> > Else
> > Range("Blink").Font.ColorIndex = 2
> > End If
> > RunWhen = Now + TimeSerial(0, 0, 1)
> > Application.OnTime RunWhen, "StartBlink", , True
> > End Sub

>
> > Sub StopBlink()
> > Range("Blink").Font.ColorIndex = xlColorIndexAutomatic
> > Application.OnTime RunWhen, "StartBlink", , False
> > End Sub

>
> > ' In both these procedures, change the reference to A1 to the cell
> > that should blink.

>
> > ' When the workbook is closed, you need to cancel OnTime event
> > triggers,
> > ' so put the following code in the ThisWorkbook code module.
> > Private Sub Workbook_BeforeClose(Cancel As Boolean)
> > StopBlink
> > End Sub

>
> > ' You need to initiate this procedure when the workbook opens, so put
> > the following code
> > ' in the ThisWorkbook code module:
> > Private Sub Workbook_Open()
> > StartBlink
> > End Sub
> > ---------------------------------------------------------

>
> > Its working fine as long as no other excel file is not open. As soon
> > as I open anything else following error open.

>
> > "Run-time erroe '1004': Method 'Range' of object'_Global failed."

>
> > Could anyone please help as I want to use this code while other files
> > are open.

>
> > Upon receving comments from the group I adjusted the code to reflect
> > the specific workbook.

>
> > Thanks for the reply.

>
> > I tried putting that code in as follows.
> > ----------------------------------------------------------------------
> > Sub StartBlink()
> > If
> > Workbooks("DailyBalance").Sheets("Main").Range("Blink").Font.ColorIndex
> > = 2 Then

>
> > Workbooks("DailyBalance").Sheets("Main").Range("Blink").Font.ColorIndex
> > = xlColorIndexAutomatic
> > Else

>
> > Workbooks("DailyBalance").Sheets("Main").Range("Blink").Font.ColorIndex
> > = 2
> > End If
> > RunWhen = Now + TimeSerial(0, 0, 1)
> > Application.OnTime RunWhen, "StartBlink", , True
> > End Sub
> > ---------------------------------------------------------------------

>
> > But when I re-open the file following error comes up.

>
> > "Subscript Out of range"

>
> > Any HELP?

>
> > Thanks, Naeem- Hide quoted text -

>
> - Show quoted text -


Hurray - it worked.....Thanks a lot

Naeem

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Needed - Blinking TEXT naeem.mahmood@gmail.com Microsoft Excel Programming 2 3rd Apr 2007 02:29 PM
how do I add flashing text or blinking text in Excel? =?Utf-8?B?UGF1bGEgQnJlbm5hbg==?= Microsoft Excel Misc 1 31st Oct 2006 07:27 AM
How do i remove text effects (blinking text) from my signature? =?Utf-8?B?QnJvYWRjYXN0IE1hcmtldGluZyAmIEVudGVydGFp Microsoft Access Getting Started 1 7th Aug 2006 08:09 PM
Blinking Text Mark Microsoft Access Form Coding 7 22nd Nov 2004 07:27 PM
I have an application running under XP Pro that is supposed to pull text files from the CD drive. When I try to load a text file, the app generally hangs up, never even blinking the disk light. Sometimes, if I wait long enough (15-20 minutes) it =?Utf-8?B?R3JlZWJv?= Windows XP Help 0 20th Dec 2003 01:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:05 AM.