stop automatically changing general to dates in excel - excel-formula

Here is my excel file sample.
after closing and re-opening my file its automatically change in general to date formate. For that reason my file is corrupted & I loss my accounting file. It always suddenly change formula. How can I solve this error. After changing formula it looks like "error file"
Now I want to know that: how can I stop automatically changing general to dates in excel.

I am not 100% sure this will work, but I've changed old workbooks with this issue and found the problem does not persist. Instead of leaving the formatting as general use a custom format for your numbers.
This is the custom number format I personally use because I like how it looks.
#,##0_);(#,##0);"-"
Hope this fixes it.

Related

Excel file does not open due to circular references

I have an excel file which includes multiple tabs. In each tab, there are functions, vlookups and figures, etc. The file suddenly closed and attempts to open it was not successful.
I am using Microsoft 365.
The error message that I receive when trying to open the file:
"There are one or more circular references where a formula refers to its own cell either directly or indirectly. This might cause the to calculate incorrectly. Try removing or changing these references, or moving the formulas to different cells."
What I have tried so far:
Repair office.
Checking if the file opens on another computer: it did not open.
In new excel file: go to file/options/formulas/circulation options/select to manual. The go to target file, open using "open and repair" option. Select extract data. Select recover formulas.
I really appreciate any help
First, that's really frustrating (I know, I've been there). Second, what often works is to disable Excel's automatic formula checking temporarily. Open a blank file in Excel. Then go to File -> Options -> Formulas -> Calculation options -> then switch it from automatic to manual. That should stop Excel from checking for the error and hence from preventing you from opening your file.

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.

How to know which formulae were recovered / corrupted in an Excel file

I have a program which generates an Excel file. Specifically, it's a node app which generates a JSON file which is loaded into GrapeCity's SpreadJS and exported again via their ExcelIO libs. This file has a lot of formulae in it - at least a thousand of various forms built according to various rules from an input data set which is itself non-trivial. Whilst these files load file in SpreadJS and export in such a way that they load in Excel and appear to work, I get a number of errors from Excel when I try to load it:
Excel completed file level validation and repair. Some parts of this workbook may have been repaired or discarded.
Removed Records: Formula from /xl/worksheets/sheet1.xml part
Removed Records: Formula from /xl/worksheets/sheet2.xml part
Removed Records: Formula from /xl/worksheets/sheet3.xml part
After I initially posted this question, I eventually figured out that this was because the formulae in question were using single quotes for text strings rather than double. The question is - without playing guessing games, how could I identify which formulae Excel has removed / fixed? Excel's so-called log file is just a repetition of the equally unhelpful references.
Any of the following would count as good answers:
A way to get Excel to tell me the string of the formula which it has a problem with
A way to get Excel to tell me the cell reference (e.g. F5) of the formula which it has a problem with
An external tool which would do the same
A library or tool for validating Excel formulae which I could run on either the Excel file or the original input which would give me similar output. If it was an npm lib that would be even better
thank you for using SpreadJS.
Can you please share the original spreadjs file (ssjson) with our team, they can perform the export and figure out what might be causing this. In general exported files should not product file open errors, even if the formula is incorrect.
Grapecity Team
http://www.grapecity.com/spreadjs
https://github.com/LesterLyu/fast-formula-parser/ works for verifying formulae.

EPPlus changes cell interior color

I found something really strange while using EPPlus and I couldn't find the solution anywhere online (I also didn't find anyone with the same problem to be fair). Luckily, after some time, I found out how to fix it and because I couldn't find anything about it, I want to save someone else his/her time and document it here. Note, the past week was my first experience with EPPlus so I'm sorry if this question is very trivial and everyone knew this already.
The Issue
I'm trying to put data into an existing Excel template using EPPlus. One of the sheets of the Excel file looks like this:
Nothing strange about it you would say. However, when I open this Excel file in my code and use EPPlus to add values and save it, it comes out like this:
Of course the numbers in the table are intentional, but how does it suddenly have a purple background!? Also why doesn't it happen to particular cells. There is nothing in the code that does anything with the styling. I only add values to the table.
Another strange thing is that this happened on multiple pc's, but not on all.
The underlying problem
After looking around, I found out that the standard styling suddenly showed the same purple color.
Before
After
I still don't understand why it changes the color, but it does.
Then somewhere on github, someone mentioned that you need to change the code of EPPlus to get rid of this. It mentioned that because the Excel spreadsheet was created in another language than English, it couldn't find the "Normal" style, since it's named "Standaard" in Dutch in this case, and you have to change "Normal" into "Standaard" in the code.
But I just used Nuget to get a package and didn't want to create my own package, and more important: What if I have a spreadsheet next time that is created in the English version?
The Solution
For such a long story, the solution is just to easy: In you workbook, in VBA in the immediate window, type the following code
Thisworkbook.Styles.Add("Normal")
The workbook now has a custom format called "Normal". Since it's likely that your normal format would be just blank, this will show you the proper styling.

Indirect not working

I want to reference an external workbook that is open. If I type =path\[file] directly into the cell (even though I am still asked to 'Update Values',) I am able to get the data I require. However, I am using INDIRECT because the name of the file changes everyday (date). So, I am using CONCATENATE to create a filename daily and then using INDIRECT to the cell where the concatenated formulas is. If you paste values to see what is being generated formula, it is exactly the same formula as above, =path\[file]. However, I continue to only get #REF! error.
I read through this, https://support.office.com/en-us/article/control-when-external-references-links-are-updated-87861952-ca9d-4d2a-a986-4d672c908d0d, and I still can not figure it out. I had it working on my computer at home last night but today and work it is giving me trouble.
To clarify, the formula that I am trying to get to work looks like this =INDIRECT("'"&CONCATENATE($F$129,$F$130,F95)) which worked yesterday at home. Can someone lead me in the right direction?
EDIT:
I have tried two options, =INDIRECT(F121) and =INDIRECT("'"&F121). The contents of F121 have been =CONCATENATE("'",F191,F192,F157) and =CONCATENATE(F191,F192,F157), respectively. I have also tried =CONCATENATE("'",F191,F192,F157) in the destination cell. F191 = [Liquidity Risk Dashboard v2.03 -, F192 = =TEXT(E3,"yyyymmdd")&"]", and F157 = Calculations'!D122. If I write ='[BMI Liquidity Risk Dashboard v2.03 - 20170105]Calculations'!D122 am asked to update values but, 100% have both workbooks upon in same instance
If I understand what you really have in your cells, the problem is that you are not properly naming the source workbook.
Try changing
F192: =TEXT(E3,"yyyymmdd")&".xlsb]"
Replace .xlsb with whatever the file extension really is for your file. (eg: .xlsx, .xlsm, .xls)

Resources