Blinking Text

E

Esra Dekan

Well, that doesnt work either.

I put it in there, then saved it, opened it up again, and it opened
the VBA with this error:


Compile Error:

Sub or Function not defined

Referring to this:

Private Sub Workbook_Open()
StartBlinking
End Sub

When I click off that error message, I check to see if the "immediate"
still contains that command, and although I saved it, it does not.

So, I put it back in, save again, and close the VBA and then save and
close the file, and get this message:

Compile Error:

Sub or Function not defined

Referring to this:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
StopBlinking
End Sub



So, got me stumped.
I just wont have the text blinking. It would of been nice, but not
going to all this trouble for that effect.

TY for all your help everyone.

Esra
 
D

Dave Peterson

It's time to post your macros.

What's Under the ThisWorkbook module?

What's under each (and every) general module?
 
E

Esra Dekan

Under ThisWorkbook

Private Sub Workbook_Open()
StartBlinking
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
StopBlinking
End Sub


Under Sheet1 "General"

Sub StartBlinking()
Sequence = Now + TimeSerial(0, 0, 1)
Worksheets("Sheet1").Range("x8").Calculate
Application.OnTime Sequence, "StartBlinking"
End Sub

Sub StopBlinking()
On Error Resume Next
Application.OnTime Sequence, "StartBlinking", Schedule:=False
End Sub


This in "immediate" window now

Application.EnableEvents = True




No other macros in workbook


HTH
Esra
 
D

Dave Peterson

Under Sheet1 "General"

Isn't right.

If the code is behind a worksheet, then it's not in the right place.

Select your project in the VBE
Insert|Module
Paste the code in that newly opened window.
Delete the code from behind Sheet1.
 
E

Esra Dekan

OK, (my mistake, I just assumed it went there)
that stops the compile error thing coming up and seems to be ok,
but text still doesnt blink in the requested cell.

Any ideas?

Esra
 
G

Gord Dibben

Esra

Why would assume that when you were given specific instructions to the contrary?

Quoted directly from my second post........................

a) Copy these two macros to a general code module:
=================

Option Private Module
Public Sequence As Date
Sub StartBlinking()
Sequence = Now + TimeSerial(0, 0, 1)
Worksheets("MySheet").Range("B1").Calculate
Application.OnTime Sequence, "StartBlinking"
End Sub

Sub StopBlinking()
On Error Resume Next
Application.OnTime Sequence, "StartBlinking", Schedule:=False
End Sub

===================

b) Copy these two events to 'ThisWorkbook' code module:
===================

Private Sub Workbook_Open()
StartBlinking
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
StopBlinking
End Sub

End quote..................................

And the other instructions I gave was for you enter

Aplication.EnableEvents = True into the Immediate window.

Sounds like you placed your workbook_open code into the Immediate window.



Gord Dibben MS Excel MVP
 
E

Esra Dekan

If I didnt post things in the right location thnen it is purely
because I didnt understand what you are telling me to do.

Excuse me for being ignorant abouit it, its why I am asking for help,
coz I dont know.

I didnt even know an "immediate" window existed until a very recent
post of yours when you told me how to get to it so how could I have
posted all this stuff to the immediate window.

Also, I just posted to you, telling you where things are and I only
have one thing in immediate window in that post dont i?

Look, dont worry about it, its not life or death that I get this done,
I will just do without it.

And I resent your ciomment "Why would assume that when you were given
specific instructions to the contrary?", it was uncalled for. Dont
make people out to be dumb.

Esra
 
G

Gord Dibben

The only thing I asked you to put in the Immediate window in the workbook I sent
to you was

Application.EnableEvents = True

The reason for that was to make sure events were enabled.

If you do that, close the workbook and re-open the green text should blink.

My comment was not intended to make you out to be dumb.......dumb is your word,
not mine.

It was intended only to prod you to read things a little more closely when you
are given instructions.

You and anyone else using the workbook are much better off without the annoyance
of blinking text, so abandoning the idea is a good decision.

Apologies for upsetting you.

I guess my people-skills are drifting away with the other wearing-out parts.


Gord
 
E

Esra Dekan

And i started out by saying "I know it is frowned on but", so you
would think i aheva specifc reason for it, and the reason is not
distracting, when reading the worksheet, because there is only one
thing on the worksheet.

Sorry if you dont agree with me wanting to have that effect.

Decison made, I wont now.
 
E

Esra Dekan

Oh and its also worth pointing out, that the workbook you sent me that
is supposed to have blinking in it, has all the commands in exactly
the same places as I do in my workbook, and it TOO doesnt work.

I suggest something might have been overlooked.

Esra
 
G

Gord Dibben

I suggest whatever stops B1 blinking green/no color in my workbook is at your
end.

Just wish I knew what.

You sure you have security set to medium so's you get the macro warning when you
open the workbook?

Blinks fine at my end.

Can you send it back to me if you're not too pissed off with the entire exercise
and me?


Gord
 
D

Dave Peterson

I downloaded the file and saved it to my desktop.

I opened it in xl2003 (enabling macros) and it worked fine. B1 blinked a fill
color of green.
 
G

Gord Dibben

Thanks for checking Dave.

I just tested with calculation set to manual and no blinking.

Back to auto and resumed blinking.

Would appear that Esra's calc mode has been set to manual.....maybe by opening
another workbook first with calc at manual.


Gord
 
E

Esra Dekan

Dont see what good that will do. Obviously it works for you, but it
doesnt work here. It may be somethign I have wrong in my Excel, I
dont know. I have enabled all macros on security and have set it to
the lowest level. I dont know what more I can do.

Esra
 
G

Gord Dibben

Esra

See my reply to Dave about calculation mode.

To ensure that calc mode is always on automatic when the workbook is opened,
change/add one line to the workbook_open code.

Private Sub Workbook_Open()
Application.Calculation = xlCalculationAutomatic 'add this line
StartBlinking
End Sub

Save and close then re-open.


Gord
 
D

Dave Peterson

It shows that the code works. And there is something wrong with what you're
doing.

I don't have any guesses at what that is.
 
E

Esra Dekan

My calculation mode is set to Auto

Esra



Thanks for checking Dave.

I just tested with calculation set to manual and no blinking.

Back to auto and resumed blinking.

Would appear that Esra's calc mode has been set to manual.....maybe by opening
another workbook first with calc at manual.


Gord
 
E

Esra Dekan

OK,here is a screenshot of what is happening.

I have added the line as you suggested (as you will see), my
calculations are set to auto. Its still doing the same thing.

Esra
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top