PDA

View Full Version : Getting username for last update on closed xl wb



Weebie
06-13-2007, 11:07 AM
I've written a VBA app to open, extract key data, and close some 1,900 excel workbooks that are updated throughout the day by several people. I write the data to a summary excel workbook. It's all working fine using VB 6.0(SP5) and Excel2003.

Now I'd like to add to the summary the date/time and the user for the last update in each of the workbooks . The date/time stamp is simple and under control. For the user stamp I'm sharing each workbook and tracking changes to extract the name from the track changes "History" worksheet. To create the History sheet I'm using:

With objXL.Workbooks
.HighlightChangesOptions When:=xlAllChanges, Who:="Everyone"
.ListChangesOnNewSheet = True
.HighlightChangesOnScreen = False
End With

I get the error that "xlAllChanges" is an undefined variable. If I remove the When:=... I get the error

Object doesn't support this property or method referring to the .HighlightChangesOptions When:=xlAllChanges, Who:="Everyone" line.

Any ideas where my problem might be? Could my VB 6.0 be too old for Excel 2003? Do I need to update VB somehow? Have I forgotten to load some component?

TIA for your insights.

Bob Phillips
06-13-2007, 11:18 AM
It is not VB.

If you don't have an Excel reference, it may be that it doesn't know the constant xlAllChanges. Try using the value 2 instead.