WIP: Replace ribbon KeyTip sequences with direct VBA calls - #59
Draft
sean-garwood wants to merge 1 commit into
Draft
WIP: Replace ribbon KeyTip sequences with direct VBA calls#59sean-garwood wants to merge 1 commit into
sean-garwood wants to merge 1 commit into
Conversation
Alt-keystroke commands that simulate ribbon KeyTip navigation break when users customize their ribbon layout. Replace with direct object model calls or ExecuteMso, which work regardless of ribbon state. Addresses sha5010#57 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
KeyStroke(Alt_, ...)ribbon KeyTip sequences with direct VBA object-model calls orApplication.CommandBars.ExecuteMso, so commands work regardless of ribbon customizationAlignLeft/AlignRight(no longer needed with direct property assignment)Addresses #57 (and likely #58)
Changes by file
Selection.HorizontalAlignment/VerticalAlignment; font grow/shrink ->ExecuteMso; ChangeFormat ->ExecuteMso "NumberFormatsDialog"EntireRow.Insert; autofit ->EntireRow.AutoFit; height dialog ->Application.Dialogs(xlDialogRowHeight)Application.DialogsSelection.FillDownetc.; indent/decimals ->ExecuteMso; wrap text -> direct toggle; merge/unmerge -> object model +ExecuteMso "MergeCenter"; comma style ->ExecuteMso; AutoSum family ->ExecuteMsoShowAutoFilterDropDown,AutoFilterMode,ShowAllData,UsedRange.AutoFilterPasteSpecial xlPasteValues; RTF/HTML ->ExecuteMsoExecuteMso "ReplaceDialog"ExecuteMsoNot converted (safe as-is)
ChangeFontName/ChangeFontSize(focus ribbon combo box; noExecuteMsoequivalent; genuinely interactive)ShowMacroDialog(Alt+F8standard shortcut, not ribbon-dependent)ShowFilterDialog(Alt+Downstandard shortcut, not ribbon-dependent)Ctrl+combos (bold, italic, etc.) andAlt+Shift+Right/Left(group/ungroup)Test plan
Regression checks (default ribbon)
Alt, H, F, G)Alt, H, F, K)Alt, H, F, F- kept as KeyStroke)Alt, H, F, S- kept as KeyStroke)Alt, H, A, L)Alt, H, A, C)Alt, H, A, R)Alt, H, A, T)Alt, H, A, M)Alt, H, A, B)Alt, H, N, Down, Down)Alt, I, R)Alt, I, R)Alt, H, O, A)Alt, H, O, H)Alt, I, C)Alt, I, C)Alt, H, O, U, L)Alt, H, O, I)Alt, H, O, W)Alt, H, F, I, D)Alt, H, F, I, U)Alt, H, F, I, R)Alt, H, F, I, L)Alt, H, 6)Alt, H, 5)Alt, H, 0)Alt, H, 9)Alt, H, W)Alt, H, M, M)Alt, H, M, U)Alt, H, K)Alt, M, U, S)Alt, M, U, A)Alt, M, U, C)Alt, M, U, M)Alt, M, U, I)Alt, A, T)Alt, J, T, B)Alt, A, C)Alt, A, T)Alt, H, V, V)Alt, H, V, T)Alt, H, V, S, End, Enter)Alt, E, E)Alt, P, R, S)Alt, P, R, C)Alt, A, S, A)Alt, A, S, D)Alt, A, M, Shift+Tab, Shift+Tab)Bug-fix validation (customized ribbon)
🤖 Generated with Claude Code