Locked Excel Cells Becoming Unlocked When Re Opened - excel

I have a Blueprism process which is locking a column and protecting the worksheet. The cells are then locked. When the file is saved, closed and re opened the cells are no longer locked.
GetInstance(handle).Activecell.Locked = True
GetInstance(handle).ActiveSheet.Protect

Issue was I was using a CSV. Doesn't seem to work there but does in a standard Excel Workbook.

Most of these cases are related to excel Settings, not exactly the Blueprism. I would suggest trying with Options Menu in Excel workbook and Remove Recovery flags as well.
Control+A and format sheet to Text Type and Save Manually First(One Time activity). Sometimes Formatting can be the root cause.

Related

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 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 with VBA, Workbook calculations on Manual, shift-F9 does not work

I have a large excel file with vba codes. When opening the file, excel automatically started calculating, hence it took minutes to even open the file. I set the workbook calculations in File/Options to Manual which solved the problem. However, when I run the macro now, it does not update the cells. Instead it puts the correct formulas in each cell without calculating to find the right value.
Strangely, Shift F9 does not work anymore. Yet when I go to one of the cells and press F2+ENTER the correct value is displayed.
Any idea how I can solve this issue?
creating or moving some/all reference containing worksheets (out and) into your workbook may solve it.
More details here: https://stackoverflow.com/a/56549247/1915920

Force excel workbook to avoid auto recalculation upon opening it on other PC until changes are made

I have the following situation:
I created a rather gigantic excel workbook with a bunch of excel worksheets and a lot of cross-dependencies between worksheets in it and a lot of heavy formulas. I saved this file. When I open it on my laptop it doesn't try to automatically recalculate content since Excel realizes that data didn't change. When I make changes in data recalculation is fast since changes in data will be localized and won't affect the whole workbook making it possible to make adjustments to workbook without spending hours to wait for calculation completion.
When I give a copy of this workbook to anyone else and they open it on their PC it seems that Excel decides (not sure why - wasn't able to find any answer) to recalculate entire workbook. Probably that's a default behavior when excel file is opened on different PC.
Since workbook is huge recalculation of everything in it will take forever
Is there any way to force excel to assume that whichever values are populated in the cells right now are 'correct' (that all cells don't require recalculation) but still preserve the Automatic recalculation behavior when user changes something in the data? Basically, we need to remove 'dirty' status from all cells in the workbook when it is opened on new PC.
I can not answer Your question, but i may provide a solution for Your problem:
Have You tried to enter
Application.Calculation= xlCalculationManual
Application.CalculateBeforeSave=False
into the direct-window (Ctrl+G while in developers mode)?
You can reactivate the automatic calculation modes later, for example with an "Workbook_Change" -Event, or manually in the direct-window.
I have a few other possible "Work-arounds" in mind, please let me know, if you are interested. This might also help to understand Excels calculations: http://www.decisionmodels.com/calcsecrets.htm

Erroneous Sheet Objects in Excel won't delete

I had an error in my code that I have since corrected but it made a bunch of sheets objects while it was running that I didn't notice. The sheets are not simply hidden, they don't exist in the Excel frontend and can't be unhidden.
normally I just write a code like sheet15.delete and let the VBA takes care of this kind of thing for me. But these sheets can't seem to be deleted that way. I've also checked the window setting on the view tab in Excel and the unhide option is greyed out.
I've also saved the workbook as xlsx, stripping out the VBA, with intention of importing the VBA back in from backups. But before I can even inport the VBA, the sheets are listed in the VBA editor of the xlsx file. Very frustrating and weird.
Any idea how I can delete these false sheets without starting a new project and just importing the forms?
too many sheeeeeets
Open the VBA editor and click on one of the hidden sheets. In the VBA editor there should be a properties panel, usually under the project explorer, look at the visible property and set it to "1 - xlSheetVisible." 0 is a normal hidden sheet and 2 is a very hidden sheet. Nothing can be done to a very hidden sheet.

Resources