Excel #Name Error keeps popping up each time spreadsheet is opened - excel

I have a Excel Workbook in which I have created an analysis using Datatables. For some reason each time I open the workbook, the formulas that reference the Datatable turn into #Name erorrs.
The first time I opened it, I thought I had simply made a typo and needed to reenter the formula. I did that and saved the file. On opening it two minutes later.... same error!
The error is only for two referenced columns in the datatable. Other columns from the same table reference fine, without error!
Here a sample of what the error looks like:
=SUMIFS(tblDB #REF!,tblDB[AWGW 2012],$B$3,tblDB[NWGW 2012],$B13)
The file (saved as an .xlsm) contains the following, none of which are used or touched by the formulas with the error:
Pivot Tables
VBA Code (none are event based... regular subs that need to be manually started only)
Other Datatables
I have tested on the the following Systems:
Excel 2010 (32bit) and Windows XP
Excel 2010 (64bit) and Windows 7
Does anyone have any idea why this happens?

Related

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

File corrupted after creating the second document based on template with macro

I have many Excel templates containing VBA code. Some of them create new documents based on other templates with VBA code. They all worked well until last Friday, but today I got a bad surprise: creating the first document based on a template with macro works well, but creating the second gets corrupted code.
I was able to reproduce the problem with two very small templates created from scratch:
double click on the first file to create the first document
double click on the second one to create another document
At this point you can see on the VBA editor that the VBA project for the second document is corrupted. Signs of corruption are wrong icons on the Wrokbook and Worksheet modules on the project explorer and message about catastrophic failure if you try to compile.
Using first the second template, then the first one will corrupt the second one that is opened.
Click here to get the files to reproduce the problem.
EDIT
If you don't want to download the files (I understand, thanks to the comment #Mathieu Guindon) you can create them by simply:
create a new Excel file
add a module with a simple sub that shows a message box
save it as a template with macro
repeat with a second file
Now you have the two files that you can use to reproduce the problem described above.
Microsoft has confirmed that the build 1905 is broken and corrupts the second Excel document created from a template with macros.
They sent me a (long) list of steps to uninstall Office 365, run a script to clear some cache, create a new configuration and reinstall specifying the semi-annual channel for the updates and prevent the 1905 from being installed.
Excel 2019 MSO (16.0.11629.20210) 32-bit.
=== Tested: Opening sequence and filetypes ===
• FAIL - Open an Excel template that contains VBA, then another one that contains VBA.
• OK - Open an Excel template that contains VBA, then Excel template with no code in any module.
• OK - Open an Excel template that contains VBA, then an XLSB (Excel binary file) that was created by resaving any of the previous code-containing workbooks.
=== Tested: VBA Editor's Immediate window ===
• FAIL - In VBA Editor, open a code module from the second or any subsequent workbook that has VBA in it, then run a command in the Immediate window.
• OK - In VBA Editor, open a code module from the first workbook, then run a command in the Immediate window.
=== Couldn't find any MS article about it. ===
Not listed on https://support.office.com/en-us/article/fixes-or-workarounds-for-recent-issues-in-excel-for-windows-49d932ce-0240-49cf-94df-1587d9d97093 but it's definitely an Excel issue:
Can't open more than one macro-enabled workbook and have macros actually run, unless the 2nd and all subsequent macro workbooks are .XLSB.
Even with no addins loaded.
Symptoms:
• Excel is configured to allow macros, but no macros run.
• Excel is configured to prompt for macros, but doesn't.
• Attempting to run a macro in workbooks after the initial workbook causes Catastrophic Error, Automation Error, or Compile Error.

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 !!!

Excel 2016 Chart Axis-X not showing the correctly

I have a Excel file (.xlsm type) contains lot of Charts. After switch to Excel 2016, certain charts not showing Label correctly (axis-x).
Eg. It suppose showing WK10'17, WK11'17, WK12'17,...
but it showing 1,2,3,4,....
1) I tried to reselect the data, then the label showing correctly, but after save and reopen, it become 1,2,3,4.... again
2) also tried delete the existing chart, and create a new one in Excel 2010 & 2016, problem not solve.
3) Axis Type have been set as Text
Is this a bug in Excel 2016 ? Did anyone have a solution for this ?
Below Chart showing 1,2,3,4,..., which is wrong.
Below chart is showing correctly.
Below are my table look like
1st Experiment:
Firstly, I create a whole new file in Excel 2016. Then do below step:
- Create 4 Indicators for performance review, with dummy data
- Create new chart and format it
- Create simple VBA code to hide everything, and only show related Indicator that selected
Everything work just fine, even switching around the indicator many times.
Later, Close it and reopen, 3 out of 4 charts having Axis-x label became 1,2,3,...
2nd Experiment:
I created Whole new file in Excel 2010, with 4 indicators and same VBA code.
Then Close and reopen, Axis-x format remain Perfectly good.
Transfer the file into Excel 2016 machine. Close and reopen, the Axis-x became 1,2,3....
*** Current Excel Version 1705 (Build 8201.2075)
*** Attach with these experiment files
4Q Demo.zip
Appreciate, who got interested into this issue, have a look on my file.
Share with me, if you do have any solution for that. Thanks
I found out as long as the Chart is not hide, then the axis-x will remain correctly. But this do not really help, when hiding additional chart is a must.
Another temporary workaround method is :
1) moving the data table to another worksheet.
2) Then the set the Chart's data range to another worksheet (Cannot be the same worksheet with Chart).
That will work perfectly, now can hide the chart while maintain axis-x correctly.
**** Only drawback, table have to move or duplicate into another worksheet
**** Probably Microsoft will solve this after Version 1705 (Build 8201.2075)

MS Excel 2013 linked data formula reverts to value #REF despite linked values not changing

I am currently working on an MS Excel 2013 spreadsheet (p:\master.xlsx) where some cells contain values that are directly linked from other MS Excel 2013 spreadsheets (p:\path1\feeder1.xlsx, p:\path1\feeder2.xlsx, etc).
What I am finding occasionally (not every time), is when I open up my p:\master.xlsx spreadsheet (and then "enable editing" and "enable content"), some of the values in this spreadsheet change from the correct linked value (a number) to value #REF.
When I look at the formula within these offending cells, I see it has also changed from say:
=MAX('P:\path1\[feeder1.xlsx]Sheet1'!$C:$C)
to
=MAX('P:\path1\[feeder1.xlsx]#REF'!$C:$C)
I can confirm the feeder.xlsx spreadsheet has not been moved or renamed and has not had it's values changed at all. The network drive the files sit on is also stable.
What is confusing me is that this appears to happen at random times (as opposed to every time). In addition, not all the cells revert to #REF - some of the values are still OK (and thus the formula is OK).
Due to not knowing if or when the formulas will change to their "#REF" status, I need to save the file every time I make a change (slightly frustrating).
I searched the forum and noticed another user had a similar issue on MS Excel 2010 but the answers provided did not appear to solve the user's issue. Anyone have any suggestions?
First make sure you're formula is not too long if your using 97-2003. if so save the file as .xlsx
if that don't work do the following
close all open workbooks.
open the workbook with the (now) broken links (#ref).
Click on the Data tab
Click on Edit Links.
Excel doesn't like links to closed workbooks

Resources