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

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).

Related

Excel Formula is not referencing properly - formula is modifying

Background information -
I have a macro-enabled workbook that interacts with SQL. After some cleaning steps are completed, it eventually runs an elongated list of Stored Procedures and pastes them in an external workbook. It has been working fine up until recently where many of the formulas that reference other tabs in the template are randomly having issues finding the reference...thus changes the formula. I have absolutely no idea how this is occurring.
Formula example:
=IF('16.17.A.SupCarrier'!U9="","",'16.17.A.SupCarrier'!U9)
Formula changes to:
=IF(['16.17.A.SupCarrier']'16.17.A!U9="","",['16.17.A.SupCarrier']'16.17.A!U9)
For what it is worth.....I found a "solution" to the problem. I was previously saving the document while another excel sheet was open which I assume could have been causing memory issues preventing it from saving properly. I saved this document without any other Microsoft apps open and the issue seemed to resolve itself without modifying any formulas.

View removed VBA code after repair of Excel file

I am getting an error when opening excel: We found a problem with some content in XXX. Do you want us to try and recover as much as we can? if you trust he source of this workbook, click Yes."
clicking Yes, "fixes" the issue but deletes a lot of VBA code, two weeks worth.
Whatever the issue it was introduced yesterday, I do not want to redo two weeks worth of coding. Is there anyway I can view what was removed, or open the VBA in notepad++ or something without opening the excel?
I opened another excel workbook and tried all the different options for the argument XlCorruptLoad in the Workbooks.Open to open the corrupt workbook. I noticed that there were two non existing sheets created in the project explroer of the corrupt workbook that had the code in there. I am not sure if it did that s a result of what I did or it was there all along and I did not notice it
Note that the reason I had a corrupted data is because the code was extracting a list and putting it in a cell validation formula..i guess I overloaded it.

Excel crashes on Direct Input - Excel (VBA)

I have a strange bug problem where excel keeps crashing when I simply input a value in a Table cell not range.
More Illustration on the problem:
I made a workbook (Shorthand: WB) full of codes using (MS Excel 2010), the WB have more than 15 sheets and lots of tables and defined names; each sheet has at least 1 table.Everything works fine, now, when I tried the WB on (MS Excel 2016) some sheets causes the application to crash when I input values (e.g. 10,20,A,B, ... , etc) in table cells, not a normal range, but when I input my value as formula (e.g. =10) everything is fine, also I have tried entering the values in an empty range then copying them to the table cells and this works fine.
At first I suspected that it has something to do with the missing reference as I was using OWC11 in the PC with (MS Excel 2010) and it was not there on the PC with (MS Excel 2016) so I installed but the problem is still there.
Also, for info I tried the WB on multiple PCs with (MS Excel 2013 & 2016)
I really can't find any logical reason for this crash.
EDIT:
I tried adding data validation to the cell causing the crash then remove it and I was surprised that the crash was gone !!!

Why does Formula Auditing | Trace function becomedisabled

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.

Excel Workbook freezes after saving it on Excel 2013

I am developing an excel "application" that will be distributed to a few users, so it has a lot of macros/vba code on it. The workbook is about 2MB right now, so it's not incredibly big.
I was developing it on excel 2013, however my workstation had a problem and I had to work on it from a computer with excel 2010 for about a week. Problem is, when I came back to excel 2013, whenever I try to save the workbook(on excel 2013) it immediatly stops responding. When the program closes, excel is never able to recover anything and says the file is corrupted. The problem simply does not occur on excel 2010, where everything works perfecly and I can save it OK.
Does anyone have any idea what might be causing this? I have tried removing a few sheets and saving the workbook afterwards, to test if a specific sheet was corrupted/causing problems, but even after I remove all the sheets from my woorkbook (and just leave a new blank sheet on it) it still freezes when I try saving.
It's important to note that the workbook in question uses a lot of excel features, meaning it has conditional formatting, defined names, activeX controls, shapes, formulas etc.
Well, I did what Ralph suggested and created a new excel file, then copied everything from the old workbook to the new one. Now it works fine. Apparently that was my only way out, the file was probably corrupted in some way.

Resources