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-2024324Views0likes3CommentsI'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.332Views0likes1CommentIs it really impossible to break workbook protection?
Hi, I process personal data and need strict protection (GDPR). My raw data from a survey is copied to several worksheets in a workbook and the processed anonymous data (dashboards) is in other worksheets in the same workbook. Before sending the whole workbook with the visible dashboards to my customers I delete some of the raw data worksheets and hide others. After that I protect the structure of the workbook with a code. Now only the worksheets with the dashboards are visible. Will it at all be possible for my customers to break the protection and get access to the sensitive raw personal data or am I completely safe? Thanks in advance to your reply! Best regards PerSolved6.8KViews16likes28CommentsGLSU 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?890Views0likes4CommentsDeveloper Scroll Bars Suddenly Became Erratic!
Hello, I have a very unusual problem related to developer form control Scroll Bars! I had previously enjoyed my highly reliable Scroll Bars and Spin Buttons that I had created for months (if not more than a year). Suddenly, (a few days ago) the Scroll Bars are simply no longer reliable, while only the upper button of Spin Buttons is highlighted, even if the lower one is clicked! This occurred without my tweaking! By unrealiable Scroll Bars I mean you can sometimes slide the scrolls and sometimes not. Usually, the first few work more reliably, while the later ones than freeze! It behaves erratically like that. It can help sliding previous bars and returning to the later ones, zooming in and out, and manually inserting the number and then re-fixing the Scroll Bar. Neither copy/pasting an upper working Scroll Bar, nor inserting a brand new one helps with the erratic behavior! The same applies to the Spin Buttons. Sometimes, you can click the lower button and the values will go low as expected. However, once the problem settles in, you can continue clicking the lower button, but the upper one will be selected and applied. The same temporary fixes as with the Scroll Bar (and copy/paste and recreation non-solutions) apply! I have the Excel file ready and wish to upload it here for you to see if you can produce the problem on your end! This has never happened to me before!7.9KViews0likes26CommentsCan 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! GiGi161Views0likes3CommentsExcel Macros Spreadsheets Not Loading
I've spent some time with Microsoft Support (almost 3 hours, including uninstalling my MS 365 and reinstalling it), but I'm having an issue with my Excel Macro spreadsheets not loading at all. This is what I get each time. Also having an issue with non-Macro spreadsheets that I'm unable to use the Bold, Italic, and Underline functions (get the spinning wheel and then Excel Not Responding), as well as not able to use the Format function (get the same spinning wheel and then Excel Not Responding). I've been using these same Excel Macro Spreadsheets for over 15 years. Please help!711Views1like2Comments