Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help w/Excel vb 1

Status
Not open for further replies.

pluz

Instructor
Jan 26, 2004
20
US
I need help with vb in Excel to check if workbook's Track Changes While Editing option (Tools>Track Changes>Highlight Changes) is turned ON. If yes, then I will alert the user with a message. Thanks for any help I can get with this one.

Note: HighlightChangesOnScreen prop does not work as users may have track changes while editing turned on and highlight changes on screen turned off.
 
This should do it:
Code:
If ActiveWorkbook.KeepChangeHistory Then
;-)
Cheers,
MakeItSo

Andreas Galambos
EDP / Technical Support Specialist
(andreas.galambos@bowneglobal.de)
HP:
 
Thanks, MakeItSo. This seems to work, except the message pops up whether track changes is ON or not. Would you happen to know why? This is what the code looks like:

If ActiveWorkbook.KeepChangeHistory Then
Msgbox "ALERT: Track Changes is turned ON in this document."
End If

Regards.
 
KeepChangeHistory seems to have an internal constant value, leading to the if clause always being true.
Try
Code:
If ActiveWorkbook.KeepChangeHistory[b]=True[/b] Then
Msgbox "ALERT: Track Changes is turned ON in this document."
End If
instead.
 
Hi MakeItSo - I tried that too. Do you have any other ideas that might work? Thanks for your help with this item!!
 
This is really strange: It's always TRUE...although help says it only should be when enabled :~?

I have set a breakpoint and added a watch - it's also TRUE if I have disable Track Changes...

But this worked for me:
Code:
Sub test()
With ActiveWorkbook
If .KeepChangeHistory = True Then
 If .ChangeHistoryDuration > 0 Then
    MsgBox "Track Changes on"
 Else
    MsgBox "Track Changes off"
 End If
End If
End With
End Sub

You see the trick: It's the duration property...
;-)

 
Excellent! This worked. Much thanks, MakeItSo.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top