This is odd!

  • Thread starter Thread starter hanjohn
  • Start date Start date
H

hanjohn

When I want XL to open with comment indicators visible (those little
red triangles in the corners of cells with comments) I type
Application.DisplayCommentIndicator = xlNoIndicator into the
Workbook_Open Event Procedure. If I don't want the comment indicators
then the value is xlCommentIndicatorOnly.
To me this is counterintuitive. Why have Microsoft done it this odd
way?
Ken Johnson
 
I use xl2003 and it the constants are defined correctly there.

What version of xl are you running?
 
Hi Dave
I'm running XL 2000 and 2003 on PCs and XL98 for Macintosh on old iMac.
It's the same on all of them.
Ken Johnson
 
Hi,

are you setting in Application.MoveAfterReturn property after
Application.DisplayCommentIndicator?
test the following:

Sub Test()
Application.DisplayCommentIndicator = xlCommentIndicatorOnly
Application.MoveAfterReturn = True
'This shows False
MsgBox Application.DisplayCommentIndicator = xlCommentIndicatorOnly
'This shows True
MsgBox Application.DisplayCommentIndicator = xlNoIndicator

Application.DisplayCommentIndicator = xlNoIndicator
Application.MoveAfterReturn = True
'This shows False
MsgBox Application.DisplayCommentIndicator = xlNoIndicator
'This shows True
MsgBox Application.DisplayCommentIndicator = xlCommentIndicatorOnly
End Sub

i am testing in excel2000.
maybe this is a bug since excel97.
 
Hi okaizawa,
I'm getting very confused now (nearly midnight).
I recorded 3 macros using XL 2000.
when I record tools>option>view>none (for comments) the constant is 0
and it plays back as expected.
When I record tools>options>view>indicator only the constant is
xLNoIndicator (???) and it plays back the same as the first macro,
which is expected considering the constant value but not expected
considering the recorded steps.
When I record tools>options>view>comment & indicator the constant is
xLCommentIndicatorOnly (???) and again the play back (indicator only)
is expected in terms of the constant value but not expected considering
the recorded steps.
 
I've got the same results with XL 2003 ie the constants seem OK but the
macro recorder doesn't record the right constant for indicator only
(recorded as no indicator) and indicator&comment (recorded as comment
indicator only).
 
Hi Ken,

I confirm that (for me) under xl2000,

(1) Using the xl comment indicator constants in code produced expected
results.

(2) Using the macro recorder and then reviwing the recorder code, the
following results were observed in the code:

Tools | Options | Comments | None
====> 0

Tools | Options | Comments |CommentInicator only
====> xlNoIndicator

Tools | Options | Comments |Comment & Inicator
====> xlCommentIndicatorOnly

I have never observed this before, but I doubt that I have used the recorder
to set this particular setting.
 
Hi Norman,
Thanks for the confirmation.
Now it's only a macro recorder problem, but it was definitely a problem
with the constant's definition in XL98 for Mac. I haven't yet been able
to check it out on the more recent Macs, I'll be doing that today at
school.
Ken Johnson
 
okaizawa, I now see you were right! The problem occurs when setting in
Application.MoveAfterReturn property after
Application.DisplayCommentIndicator. The problem disappears when I
reverse their order in the code.
Thanks for your help.
 
Hi,
today i tested the code about the MoveAfterReturn property in my previous
post in excel 2003. then i saw no problem there.
it was too brief time testing, but this problem might have been fixed
in the late versions.
 

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

Back
Top