developer
1353 TopicsExcel Nested Arrays: Find the Nesting Depth of Uniform and Ragged Arrays ARRDEPTH() & ISRAGGED()
Hey everyone! I’ve been diving deep into Excel’s new nested arrays features lately, and I absolutely love the flexibility they bring to data structuring. However, managing them can get a bit tricky, so I figured I’d build some specialized tools to handle them seamlessly. Public Interfaces & Arguments =ISRAGGED(array) Argument Description Default Behavior array Target nested structure to validate. Required =ARRDEPTH(array, [is_ragged]) Argument Description Default Behavior array Target nested structure to measure. Required [is_ragged] TRUE: Scans all branches for the deepest path. FALSE: Speed test on the first path only. FALSE (Omitted) TL;DR (What makes it tick): Function Name Type What It Does ARRDEPTH Public UI Returns nesting depth. Supports deep checking or fast linear testing. ISRAGGED Public UI Structural validator. Returns TRUE if array branches have uneven nesting. ANALYZE_NESTING Hidden Core Engine Multi-process recursive parser that tracks tree structure geometries. LINEARDEPTH Hidden Utility High-speed depth checker that evaluates the first element path exclusively. You can get both functions from my GitHub Gist: https://gist.github.com/Medohh2120/9cdf939036942c9672c57ccd6de696d3336Views1like6CommentsExcel can still use legacy “Move and Size with Cells” checkboxes — but can no longer create them
Excel Can Still Use “Move and Size with Cells” Form Checkboxes — But It Can No Longer Create Them A reproducible Excel compatibility regression hiding inside legacy Form Controls For years, I have used Excel workbooks containing hundreds of Form Control checkboxes attached to product rows. These checkboxes behaved exactly as you would expect: - change the row height, and the checkbox stays inside that row; - filter the worksheet, and the checkbox disappears together with its product; - remove the filter, and the checkbox returns to the correct row; - no overlapping controls; - no “click one checkbox, activate another” behaviour. Recently, while rebuilding one of these workbooks in Excel 2024 LTSC, I discovered something very strange. The old checkboxes still work perfectly. But if I delete one and recreate it — even using the same VBA code that originally created the controls — Excel creates a different kind of placement behaviour. After a full day of controlled testing, XML inspection and A/B workbook comparison, the problem became clear: Excel can still read, display, save and execute legacy Form Control checkboxes using true “Move and size with cells” behaviour — but current Excel cannot recreate that same state for a newly created Form Control checkbox through the normal UI or VBA object model. That is not just inconvenient. For existing business workbooks, it is a serious backward-compatibility problem. The simple VBA code that used to work The original controls were created with ordinary Excel VBA: Set myCBX = wks.CheckBoxes.Add( _ Top:=cell.Top, _ Left:=cell.Left, _ Width:=cell.Width, _ Height:=cell.Height) Nothing exotic. No custom event engine. No ActiveX. No external add-in. Just a standard Excel Form Control checkbox positioned exactly over a cell. The workbook contains roughly 1,000 of these controls. The old ones still behave correctly today. The problem starts only after deleting them and creating new ones. What changes? In the Excel UI, the difference is immediately visible. For an original legacy checkbox: Format Control → Properties shows: Move and size with cells The option is selected, although it is greyed out. For a newly created checkbox in current Excel: Move but don’t size with cells is selected instead. That already suggests something changed internally. But the real evidence is inside the .xlsm package. The OOXML tells the story I created two controlled test workbooks: Workbook A Original legacy Form Control checkboxes that behave correctly. Workbook B The same workbook, but the checkboxes were deleted and recreated in current Excel using the original VBA logic. The internal OOXML differs. The working legacy controls contain placement information equivalent to: moveWithCells="1" sizeWithCells="1" and use genuine two-cell anchoring. The newly generated controls are instead stored using one-cell-style placement semantics, including: <xdr:twoCellAnchor editAs="oneCell"> The important part is not merely the XML syntax. The resulting behaviour is observably different. With the legacy control, both ends of the object are anchored to the worksheet grid. With the newly created control, Excel effectively preserves the control size while cells move underneath it. That distinction becomes disastrous when rows are resized, hidden or filtered. Why filtering exposes the problem Imagine a checkbox sitting on row 50. With the legacy behaviour: Checkbox ↔ Row 50 boundaries When row 50 changes size, the checkbox changes with it. If row 50 is filtered out, the control disappears with the row. When the row becomes visible again, the control is still exactly where it belongs. With the newly generated control, its dimensions are not tied to both cell boundaries in the same way. After repeated resizing and filtering, controls can begin to overlap. That leads to one of the worst possible spreadsheet UI failures: You click the checkbox you can see, but another checkbox receives the click. For a workbook containing hundreds or thousands of rows, this makes the controls unreliable. “Just use .Placement = xlMoveAndSize” That was the obvious first solution. Excel VBA defines: xlMoveAndSize as the placement mode where an object moves and resizes with cells. So I tested: myCBX.Placement = xlMoveAndSize and: myCBX.Placement = 1 I also tested placement through the corresponding Shape: ws.Shapes(myCBX.Name).Placement = xlMoveAndSize And through a ShapeRange. And through DrawingObjects. And even the commonly suggested workaround: Group controls → set Group.Placement = xlMoveAndSize → Ungroup None of these recreated the original internal state in Excel 2024 LTSC. The workbook continued to serialize the new controls differently. This matches long-standing Microsoft guidance that Form Control checkboxes do not normally support “Move and size with cells” as an editable option, while ActiveX checkboxes do. And yet — this is the important part — existing legacy Form Control checkboxes in real workbooks can still possess and use that state. The most revealing experiment I then modified the OOXML manually. I took the newly generated workbook and patched the checkbox placement metadata to match the working legacy controls: moveWithCells="1" sizeWithCells="1" with proper two-cell anchoring and without the one-cell override. Then I reopened the workbook in Excel 2024 LTSC. And it worked. Immediately. No custom VBA reposition engine. No ActiveX. No workaround running continuously. The same Excel installation that would not create this state through VBA had absolutely no problem: - reading it, - displaying it, - saving it, - resizing the controls with rows, - and filtering them correctly. That is the key finding. The Excel rendering and file engines still fully understand this checkbox state. The missing part is the supported creation path. So is this an unsupported feature or a compatibility regression? Microsoft has historically documented Form Control checkboxes as not supporting “Move and size with cells” in the normal UI. That makes the situation unusual. The issue is not simply: “Excel removed a documented checkbox feature.” The stronger and more accurate statement is: Excel supports a legacy Form Control state in existing workbooks, continues to execute it correctly, but no longer provides an ordinary supported mechanism to reproduce that same state for a replacement control. For users maintaining long-lived Excel systems, the difference is academic. If an old control is accidentally deleted, replacing it with an apparently identical Form Control changes the behaviour of the workbook. That is a backward-compatibility problem. Why not switch to ActiveX? ActiveX checkboxes support richer placement behaviour. But that creates another problem. Microsoft now disables ActiveX controls by default in Microsoft 365 and Office 2024 for security reasons. When ActiveX is disabled, users cannot create new ActiveX objects or interact with existing ones. So the official alternatives are hardly attractive: Legacy Form Controls Lightweight and reliable — but cannot reproduce this legacy placement state normally. ActiveX Supports more control behaviour — but is now a legacy security-sensitive technology disabled by default in current Office. New in-cell checkboxes Architecturally much better — because the checkbox is part of the cell and represents TRUE/FALSE. But Microsoft’s own documentation currently lists the feature for: - Excel for Microsoft 365 - Excel for Microsoft 365 for Mac not Excel 2024 LTSC. That leaves perpetual Office users in an uncomfortable middle ground. This is where the product story becomes difficult to defend I am not claiming that Microsoft intentionally removed this behaviour in order to sell subscriptions. There is no evidence for that claim. But the resulting user experience is still hard to justify: 1. Excel can execute the legacy checkbox behaviour. 2. Excel can preserve it. 3. Excel can save it. 4. Excel accepts a manually patched workbook containing it. 5. Excel’s current object model does not provide a reliable way to recreate it. 6. The modern replacement — native in-cell checkboxes — is documented for Microsoft 365 rather than Excel 2024 LTSC. 7. The other legacy alternative, ActiveX, is now disabled by default for security reasons. For users maintaining mature Excel applications, this is a poor migration path. Why this matters beyond checkboxes This is not really a story about one checkbox property. It is about the contract users expect from long-lived productivity software. Excel workbooks are often not disposable documents. They can be: - product-management systems, - pricing tools, - engineering calculators, - operational forms, - purchasing systems, - inventory tools, - reporting applications, - or business processes maintained for ten or twenty years. When Excel continues to support the execution of an old document feature but silently prevents users from recreating an equivalent object, maintaining those systems becomes unnecessarily difficult. Backward compatibility should mean more than: “The file still opens.” It should also mean: “A user can maintain the workbook without reverse-engineering its OOXML package.” What Microsoft could do There are several reasonable fixes. Option 1 — Restore proper placement support Allow: CheckBox.Placement = xlMoveAndSize to generate the same placement state that Excel already understands for legacy controls. Option 2 — Expose the existing capability If the engine already supports it, expose “Move and size with cells” again for Form Control checkboxes. Option 3 — Provide a migration path Make the new in-cell checkbox functionality available to perpetual Excel releases as well, or provide an official conversion tool from legacy Form Controls to cell checkboxes. Option 4 — At minimum, document the limitation If this legacy state is intentionally read-only for compatibility, document it clearly. Currently, a user can spend hours debugging VBA without realizing that two visually identical Form Control checkboxes can have fundamentally different internal placement semantics. A workaround exists — but users should not need it The workaround I eventually used was to modify the .xlsm OOXML package so that newly generated controls use the same anchor metadata as the working legacy controls. That solved the problem immediately. But manually patching Office XML should not be necessary to restore behaviour that Excel itself already supports. It is a useful proof of concept. It is not an acceptable product-level solution. The reproducible evidence I have retained minimal A/B test workbooks demonstrating the problem: OLD Original Form Control checkboxes with correct legacy placement. NEW The same workbook after deleting and recreating the controls. The differences can be reproduced and inspected directly in the workbook OOXML. I would be happy to provide the files to Microsoft Excel engineering. Final thought Excel’s reputation was built partly on extraordinary backward compatibility. That is why companies still trust .xls and .xlsx files created years — sometimes decades — ago. This case shows an uncomfortable edge of that compatibility: Excel remembers how to use an old feature, but appears to have forgotten how to create it. When the workaround is to unzip an .xlsm, manually alter OOXML placement records, rebuild the package and reopen it in Excel — and Excel then works perfectly — it is difficult to argue that the capability itself is gone. The engine still knows how. The user simply no longer has a supported button or VBA path to ask for it. Microsoft, please give that capability back — or provide a proper migration path. Sources Microsoft documentation for native cell-based checkboxes: https://support.microsoft.com/en-us/excel/using-check-boxes-in-excel Microsoft-hosted discussion on Form Control checkbox limitations: https://learn.microsoft.com/en-us/answers/questions/4813119/is-there-a-way-to-assign-a-checkbox-to-a-cell Microsoft documentation on ActiveX controls being disabled by default: https://support.microsoft.com/en-us/office/vba/activex-controls-are-disabled-by-default-in-microsoft-365-and-office-2024326Views0likes3CommentsI'm looking for a practical way to calculate Pakistan salary income tax in Excel.
The goal would be to enter a monthly salary and have the spreadsheet estimate the applicable tax and resulting take-home amount. Ideally, the calculation should be easy to update when the applicable tax slabs or salary-related rules change. For someone building this in Excel, would you recommend keeping the tax slabs in a separate lookup table and using formulas against that table, rather than hard-coding the rates into one large formula? I'm particularly interested in approaches that make the spreadsheet easier to maintain when tax rules change.332Views0likes1CommentGLSU Excel add-in fails to load after Office update from Version 2607 to 2608
Our Excel add-in, Process Runner GLSU , fails to load after Microsoft Office updates from Version 2607 to Version 2608. This started August 17, 2026 and is actively growing in scope. Error messages: Excel: Cannot run the macro 'onLoad' VBA: System Error &H80004005 (-2147467259). Unspecified error VBA: Compile error in hidden module: ThisWorkbook Has anyone encountered similar issue with their own custom add-on. If yes, any pointers to fix it. We are seeking help on priority. Thanks, Vrushali Pawale, Sr. Manager, Insightsoftware.1KViews0likes1CommentVBA Code stops
Not sure what is going on... this was working and now all the sudden the code stops part way through. Here is the current code (linked to a button) Private Sub CommandButton2_Click() Dim cofCom As Object Set cofCom = Application.COMAddIns("SapExcelAddIn").Object Dim api As Object Set api = cofCom.GetPlugin("com.sap.epm.FPMXLClient") api.RefreshActiveWorkbook Application.ScreenUpdating = False ActiveWorkbook.Sheets("Spend Detail").Activate Sheet14.CommandButton2_Click Sheet14.CommandButton1_Click ActiveWorkbook.Sheets("Spend Detail 1").Activate Sheet21.CommandButton4_Click Sheet21.CommandButton3_Click ActiveWorkbook.Sheets("Spend Detail 2").Activate Sheet22.CommandButton6_Click Sheet22.CommandButton5_Click ActiveWorkbook.Sheets("Spend Detail 3").Activate Sheet23.CommandButton8_Click Sheet23.CommandButton7_Click ActiveWorkbook.Sheets("Spend Detail 4").Activate Sheet24.CommandButton10_Click Sheet24.CommandButton9_Click ActiveWorkbook.Sheets("Spend Detail 5").Activate Sheet25.CommandButton12_Click Sheet25.CommandButton11_Click ActiveWorkbook.Sheets("Spend Detail 6").Activate Sheet27.CommandButton14_Click Sheet27.CommandButton13_Click ActiveWorkbook.Sheets("Finance Input Sheet").Activate Application.ScreenUpdating = True End Sub The problem is that all tabs update for the refresh but for some reason, going to each sheet and clicking the buttons is not occurring now. It is essentially stopping at line 6 and I have tried removing the screenupdating false and true and that did not make any difference. Just like for some reason the code stops and it was working a week ago. Any suggestions?890Views0likes4CommentsCan anyone help me with this SWITCH function
Hello Everyone, This SWITCH function is used to produce a number that then I can use to sort workers and their functions. =SWITCH(TRUE, IF(AND(ISNUMBER(J2)=TRUE,M2="Working")=TRUE,5,0), IF(AND(ISNUMBER(K2)=TRUE,M2="Working")=TRUE,500,0), IF(AND(ISNUMBER(J2)=TRUE,M2="Special Project")=TRUE,15,0), IF(AND(ISNUMBER(K2)=TRUE,M2="Special Project")=TRUE,515,0), IF(AND(ISNUMBER(J2)=TRUE,M2="Stand By")=TRUE,20,0), IF(AND(ISNUMBER(K2)=TRUE,M2="Stand By")=TRUE,520,0), IF(AND(ISNUMBER(J2)=TRUE,M2="Special Project UFN")=TRUE,25,0), IF(AND(ISNUMBER(K2)=TRUE,M2="Special Project UFN")=TRUE,525,0), 50 ) In Column J I have their Start Time, from the Kronos System, and in Column K I have their End Time. In Column M I have Tasks names that would indicate what each Team member is doing. Each component does evaluate correctly but the function always return 50? What am I missing here? Thanks in Advance! GiGi161Views0likes3CommentsGetting data from Snowflake to Excel
Hello I have multiple no technical users and am trying to find a way to setup a snowflake query for them and then let them refresh it whenever they want or on a schedule, but I couldn't find a good solution this what i found so far: ODBC (Not great for non technical users needs setup on each user desktop) Power Automate (Needs Power Automate Premium which we don't have) Third Party tools (Expensive pricing models) Through Power BI (We want to separate this process from power bi) Any suggested solution please!Solved781Views0likes3CommentsPlease allow this foundational concept for algorithms
Hello dear friends of Excel. Please let me begin by thanking you all for giving us the excellent tool that Ms Excel is. I've being working practically my whole Computer Engineer career (~18 years) with this awesome tool, and I cannot imagine doing my work without it. It really is excellent, and has been enhancing a lot in the last years. In this occasion I would like to ask you to consider including in Excel, native support for "empty arrays", that is, arrays that have "0" (zero) items. This feature would help a lot in the following type of algorithms: When you have to scan a range of cells that hold the items of a set named "S", and from that set you have to select only the items that satisfy a given condition { ALL i | such that CONDITION(i) = TRUE }, and with those selected items (i) you have to construct a new vector named "V" In this case you usually need to begin with an "empty array", that is the initial value before adding any selected item, and at some point as you process the algorithm, maybe you will find the 1st. item to add to the "empty array" Maybe you won't find any item that satisfy the condition, and at the end of the algorithm, you will end up with an "empty array" as a result. To illustrate this type of algorithm, let me put an example: =LET( vector; SEQUENCE(10); new_vector; REDUCE( 0; vector; LAMBDA(building_vector;vector_i; IF(RESIDUO(vector_i;2)=1; VSTACK(building_vector; vector_i); building_vector ) ) ); INDEX(new_vector;SEQUENCE(ROWS(new_vector) - 1) + 1) ) This "algorithm", scans a set S = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 } from S, it selects only the "odd numbers" { ALL i | such that "i is odd" }, it takes every odd number and adds it to the array named "building_vector", "building_vector" begins as a non-empty-array, holding "1 sentinel item" at the beginning of the algorithm (the number "0"), at the end of the algorithm, I have to do a work-around, to remove manually the 1st. sentinel item from the array The cons of this approach are: sometimes the resulting array will not have any selected item, that is, it will be an "empty array", and as such, Excel will generate an error showing #CALC! as Excel doesn't currently support empty arrays, I have to do this workaround to add an initial sentinel item at the beginning of the algorithm, and then I have to remember to remove it at the end of it Dear friends of Excel, I consider empty arrays to be a "foundational concept for algorithms". It's like the "zero" for numbers, but for arrays. It would be nice to be able to write this kind of algorithms with the aid of Excel, being able to natively support "empty arrays" without me having to do the extra work of handling a simulated situation of an empty array. I present you this request, and I ask you to please consider the importance of this feature. Thanks in advance!163Views0likes2CommentsExcel can't open file from hyperlink after upgrade windows11
Hello, I met a strang issue. After upgrade system from w10 to w11, my excel can't open linkage file which was working normal before. Tested file and folder which located on local and SMB was not working, after click the hyper-lnik nothing happen and no pop-up just turn to mouse to loading icon then nothing happen how can I check which part cause this issue? Also tested on word have same issue. Further, url was working normal.239Views0likes2Comments