Reputation: 4956
I want from VBA to start/stop "Track changes" functionality in Excel.
Searching thru the Net I saw a property called TrackRevisions
of ActiveDocument
object. Supposedly in MS Word writing ActiveDocument.TrackRevisions = True
should turn on "Track changes".
But in MS Excel this line gives 424 Object required
run-time error. Same error is returned when trying with ThisWorkbook
. Changing it to ActiveSheet
brings 438 Object doesn't support this property or method
error.
Upvotes: 2
Views: 9997
Reputation: 31
The questions is really what do you want to achieve. If you want to track changes in a spreadsheet, I assume you have some other users editing the workbook, and you want to record who changed what, as well as review/approve any modifications later on. Well, you don't actually need a triggering macros for that.
... instead of Track Changes, try comparing two workbooks using the Microsoft's Spreadsheet compare (application is limited to Excel 2013, Excel 2016 , Office 365 Professional).
... instead of Track Changes, you can record history of changes made to the workbook (who changed what and when) - XLTools Version Control.
I use both depending on the task.
Upvotes: 0
Reputation: 9
You can use the following code. You will see this code when you record a macro.
With ActiveWorkbook
.HighlightChangesOptions When:=xlAllChanges
.ListChangesOnNewSheet = False
.HighlightChangesOnScreen = True
End With
Upvotes: 1
Reputation: 55682
For a shared workbook you can use VBA from these links (the method is ActiveWorkbook.HighlightChangesOptions
)
This doesn't offer the same depth of tracking as available in Word, for example from the first link in my post,in Excel:
If that isn't what you were chasing you may be able to employ specific VBA to track
But if that is the case we will need more information from you as to what you are chasing.
Upvotes: 1