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

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

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.

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

Cell references/formulas in Excel to other workbooks on Sharepoint don't update values

The problem
I have eight Excel documents that are stored on a Sharepoint site. One of those documents (“receiving file”) contains formulas/cell references to the other seven documents (“source files”) on Sharepoint.
Everything works when the references are created.
Once the workbooks are saved and closed and then reopened, the receiving file no longer updates the values from the source files.
The files are synced in Windows Explorer and opened in the desktop version of Excel. Also, all eight files are opened at the same time.
The reference will first look something like this
='[Source file.xlsx]Sheet1'!$A$1
After closing and reopening, the references will look like this
='https://somecompanyname.sharepoint.com/sites/SitefortestingExcelreferences/Shared Documents/[Source file.xlsx]Sheet1'!$A$1
If I now change a value in the source value, the change will not appear in the receiving file.
What I tried so far
Setting “Calculation” to “Automatic.
Click “Calculate Now” and “Calculate Sheet”.
Double-click into the cell with the reference and hit enter.
In “Data > Queries & Connections” click “Refresh all”
In “Data > Queries & Connections > Edit Link” I clicked on update values. It did not help. However, I tried to rebuild a simple system with just two files and a single reference, and here it did work
Starting from point 5) I programmed a little macro that updates all links in all open workbooks (it did not help either):
Option Explicit
Sub UpdateAllConnections()
Dim wbWorkbook As Workbook
For Each wbWorkbook In Application.Workbooks
wbWorkbook.UpdateLink Name:=wbWorkbook.LinkSources, Type:=xlExcelLinks
Next wbWorkbook
MsgBox "Update complete.", vbInformation, "Complete"
End Sub
If I remove the path to SharePoint, so the formula looks like this
='[Source file.xlsx]Sheet1'!$A$1
It works again (until I save and reopen).
I found the following on Microsoft Answers (about OneDrive but it's probably the same issue):
https://answers.microsoft.com/en-us/msoffice/forum/all/excel-value-links-not-updating-on-onedrive/e48a7680-71e6-4a77-9eb1-e03ec7f0e3e0
I contacted the official O365 support desk and they told me this is built into the connection between Excel and OneDrive.
They have received thousands of complaints and there is no fix for it.
No option to tell Excel/Office/OneDrive to link to local copies of files on 1D by default.
No fix is planned as this is not how MS envisions how Excel/1D should be used.
My question
Any suggestions? Are there any tools in Excel that can be used to update the linked cells automatically or manually? Might SharePoint settings prevent the update?
If not, since removing the file path to SharePoint seems to work is there a way (using VBA) to remove the full file path from all cell references, so
='https://somecompanyname.sharepoint.com/sites/SitefortestingExcelreferences/Shared Documents/[Source file.xlsx]Sheet1'!$A$1
becomes
='[Source file.xlsx]Sheet1'!$A$1
I could probably loop through all cells and simply replace the path with nothing, but that would only work if I know the file path beforehand and if all the files are stored in the same SharePoint folder.
I had the same issue and here is my workaround: I can open the source file on the Sharepoint site by clicking ... and then Open in App (as opposed to Open in Browser) The referecence cell in the receiving file will become ='[Source file.xlsx]Sheet1'!$A$1 again and get automatically updated.
My workaround would be to consolidate external links onto a single sheet, and manually or use a macro to copy / hard paste to another identical page that you use for the links.
Just run the macro when you have the workbook open on your desktop to update the values.
Even simpler, you could also have a sort of database with linked values in a column and hard copies pasted into another column. This would be simpler than two identically sized sheets.
BUT, you could also go crazy and have named ranges like quarterly_total_formula and an analogue somewhere else called quarterly_total_valueonly and then write a macro to iterate over each with a for each looking for things "LIKE" *_formula and hard paste each result into the complementary *_valueonly spot... but then you'd need a macro to check that they were all paired... and by that point you might as well not waste your time in Excel and develop in Power BI, Tableau, RMarkdown, or heck learn Adobe Illustrator or work directly in HTML.

Excel is unfilling calculated cells at random

I have an Excel file on SharePoint.
Multiple people edit said file.
Offline and online.
Excel unfills all calculated cells (VLOOKUP and MATCH) that depend on other sheets in the same workbook at random.
So if you would open or reload that file, suddenly all the cells that use VLOOKUP or MATCH would be blank.
Upon further investigation nobody changed anything or deleted anything.
It just happens randomly.
Now it has happened 2 weeks ago and just today.
I have an interim solution that is to go to a cell with a formula, hit return, then click „overwrite all cells in this column with this formula“ and then click undo to prevent custom cell content to be overwritten.
Everything is back to normal afterwards.
I talked to a colleague, he has the exact same issue also totally at random.
He also encountered this on files that are not being edited by multiple people but himself.
So it is not dependent on the file itself.
Could the language play into this problem?
On some PCs Excel is in English and on some in German.
=IFERROR(IF(ISNA(VLOOKUP(D185,Sheet1!$B$3:$D$616,3,FALSE)),(VLOOKUP(D185,'Sheet2'!$B$3:$D$22200,3,FALSE)),(VLOOKUP(D185,Sheet1!$B$3:$D$616,3,FALSE))),"")
Seems like your sheet isn't calculating upon open. See if this link is of use to you.
https://superuser.com/questions/448376/what-is-the-excel-hotkey-to-re-calculate-all-formula-in-sheet
Also check your program settings and see if auto-calculate sheets is enabled. Don't know from the top of my head where it is located.
Alternative create a small vba function to force recalculate on workbook open.
Getting Excel to refresh data on sheet from within VBA

excel files in sharepoint - referencing

I found this question and it seemed similar to my problem but I think that they are distinct enough to ask my question seperately. (I am happy to be wrong).
I have 2 excel spreadsheets. Spreadsheet 1 is a common spreadsheet to a few departments in my office so cannot be modified but I wish to use some of the data contained within to run spreadsheet 2. I am trying to do this organically within excel.
When I initially built spreadsheet 2 I had an 'offline' copy of spreadsheet 1 sat in my user folder so that I could test and debug quickly. Now that I come to try to use the 'online' version, I can initially set up the references fine. When I close spreadsheet 2 and reopen it I get asked if I would like to update the references as normal, but now it throws an error, it cant find the document in sharepoint.
I figure that my problem is this - when I initially reference the cells, the reference is pointing to some temp location that is produced when I had spreadsheet 1 open. So as soon as I close that spreadsheet the links are broken. Does this sound like a feasible explanation for what is happening?
If that is the case: How do I get the reference to point at a cell within spreadsheet 1 located on sharepoint?
Cheers for the help

Resources