Why does Formula Auditing | Trace function becomedisabled - excel

TL;DR: Why/How does a workbook suddenly have Trace Auditing disabled (not protected)? What causes Excel to activate this behavior?
I was working on an Excel spreadsheet that I had created a while back and wanted to use the Formula Auditing "Trace Precedent" functionality. To my surprise it was grayed out. Everything else worked fine except that feature. Neither the workbook nor the worksheet were protected.
Searching the web I was able to quickly find a solution:
File Menu>Options>Advanced>Display Options for this workbook>For Objects shown: select **"all"**
I want to know how to prevent this from popping up as an issue for employees who use my templates. Or what triggers it. I certainly didn't set this option in Excel on purpose.

I've discovered another reason why some of the formula auditing functions get disabled, even in worksheets where objects are being shown properly.
If I Ctrl+LeftClick more than one worksheet name tab at the bottom (which I do to include more than one sheet when I print), five of the six functions become greyed out, leaving only Show Formulas available. This peculiar behavior is present in Office 2010 for Windows and in Microsoft 365 (a.k.a. Office 365) for Windows.

Related

Microsoft Excel keeps repairing my .xlsm file for no apparent reason and eliminates data validations on a sheet

I recently created an automated Excel utility (using Microsoft Office 2019), in which I've extensively used data validations, VBA code, named ranges and formatting. It was working well until one day I received an Excel prompt message that read:
When I click on Yes, it gives me another pop-up where it says it recovered the file, and also gives me a link to the error log XML file. I click on it and open the .xml file using my default browser, and it shows the following details:
Looks like it is removing data validations from a particular sheet, and I realize that is true when I navigate to that sheet in the UI. To work around this unwarranted and repeated data-validation removal that Excel application is enforcing, I created a macro code that will re-instate all these data validations as required. The real problem arises when this Excel file is opened on a different computer with Microsoft Office 365. Looks like it is removing not just data-validations but also other components like named ranges and buttons. There could be other things that it might be removing, which I am unaware of at the moment. So the macro created to re-instate the data-validations is no longer useful.
Why does this problem arise? And why is different version of Excel behaving differently? How do I solve this? Appreciate your kind help. Thank you!
As rightly suggested by Ron Rosenfeld and e_conomics, the issue was with the data validation lists, whose sources were strings of comma separated values that were going beyond 255 characters. Apparently, that is a limitation with Excel.
When I replaced the sources of data validation lists (string of comma separated values) with the ranges containing the corresponding values, the problem resolved itself. The repair dialogue never appeared again.

VBA opens Outlook from a Watch window

Recently I've stumbled upon a strange behaviour of VBA. In my Microsoft Excel Macro-Enabled Worksheet I have several sheets, with one named "Log". While I was debugging a code, I added a new watch with an expression Worksheets("Log"). When I click on the + box in front of it to expand the expression, Welcome to Outlook 2016 wizard pops up?!
On each subsequent click on the expression, New Profile window pops up.
Funny thing is, I don't even use Outlook and it alone cannot be uninstalled from the system and rest of the Office package. So, what is happening here and how can I prevent this strange behaviour?
I have it too, also when I have the watch set to a page of the worksheet.
It seems to happen when I forget to activate the sheet before I access it. After doing that the Macro and watch behave as expected.

Renaming worksheet gives 'Out of Memory'; CurrentRegion property fails

My employer has recently upgraded from
Excel 2013 (15.0.4805.1001)
MSO (15.0.4919.1002) 32-bit to Excel for Office 365 MSO (16.0.11328.20362) 32-bit
There are no active add-ins (other than referred to below when loaded).
An Excel add-in (xlam) that I have created no longer functions correctly.
The add-in works with an open workbook and formats a lot of 'raw' data as tables (listobjects) and creates a number of PivotTables and Charts in a dashboard-style layout. During the process some blank sheets are copied from the add-in to the open workbook, and renamed as required.
For the most part, everything works fine (pivots created, dashboard created). At the end of the process I create an index sheet by copying a blank sheet from the add-in, and re-naming it (as ...Index). This is where things go wrong. Excel just seemed to 'hang'. On investigation I discovered that the sheet was not being renamed (so further processing stopped).
Delving into this further with error-trapping turned off, if I try to rename the sheet using the immediate window, I get
run-time error 7 Out of Memory
Further, if I manually rename the sheet (Excel interface) and then set the code running from that point, I've discovered that I can't use the CurrentRegion property (some sorting is done on the newly inserted sheet). Any attempt to use CurrentRegion results in
Unable to get the CurrentRegion property of the Range Class
This also applies to using the immediate window on ANY open workbook (e.g. ?Activesheet.range("A1").CurrentRegion.Rows.Count)
These errors persist during the current session of Excel (that is, I can create a blank workbook and try to rename a sheet using VBA but get an error; manually renaming a tab is OK). If I restart Excel everything is fine.
I require to use some global/public variables but (given that everything worked in Excel 2013) can't see that these would be the problem.
Any ideas?
After a further couple of hours looking into this, I established that the error was related in some way to a module which added slicers to the dashboard. The slicers were, in fact added (and stepping through the code no errors were generated).
Adding the slicers in a slightly different fashion appears to have got around the problem, although I am still none the wiser as to why it actually occurred in the first place (the original code for the slicers worked fine in Excel 2013).

Updating excel macros with clickonce

We have developed a complex excel workbook that has numerous tabs and lots of excel macros tied to various cells within the workbook. We plan on distributing the workbook to users via clickonce from a common network share so we can push updates to the spreadsheets as necessary.
Once thing we have noticed is that it appears when we try to update the macros in the workbook that these are not updated via clickonce -- only the changes in individual tabs are made. But the excel macros don't seem to get updated.
Is this expected behavior? Are we doing something wrong with clickonce? It seems like a critical flaw in the clickonce design if macros can't get updated.
Not sure how to proceed -- suggestions eagerly sought!
Thanks,
Mark

Is there a way to trigger "track changes" through VBA in Excel?

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.
For a shared workbook you can use VBA from these links (the method is ActiveWorkbook.HighlightChangesOptions)
HighlightChangesOptions Method Excel 2003 VBA Language Reference
Workbook.HighlightChangesOptions Method
Office 2007
Workbook.HighlightChangesOptions Method (Excel)
Office 2010
This doesn't offer the same depth of tracking as available in Word, for example from the first link in my post,in Excel:
Change tracking differs from undo and backup
Some types of changes are not tracked Changes that you make to cell contents are tracked, but other changes, such as formatting changes, are not tracked.
Change history is kept only for a specific interval
Change history is periodically deleted
If that isn't what you were chasing you may be able to employ specific VBA to track
certain cells, or
compare versions
But if that is the case we will need more information from you as to what you are chasing.
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
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.

Resources