-
-
Notifications
You must be signed in to change notification settings - Fork 626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support in-cell editing in Excel 2016/365 #9290
Conversation
Here is a try build: https://ci.appveyor.com/api/buildjobs/gm6vehptupg96r26/artifacts/output%2Fnvda_snapshot_try-i8146-16783%2Cb124149d.exe |
I have just confirmed that the try build 16783 resolves an issue reported from Japanese users:
I have tested with Microsoft Office 365 Business (Version 1901) with English experience / Windows 10 (64bit) Version 1809 with English experience. Discussion in Japanese is as follows: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not yet been able to test this code though, but it looks good.
if e and e.cachedAutomationID=="CellEdit": | ||
obj=UIA(UIAElement=e) | ||
obj.parent=api.getFocusObject() | ||
return obj |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be override the AutoProperty here, as I assume the lifetime of this focusRedirect will be as long as the Excel6 Window itself?
self.focusRedirect = obj
In that case,
source/appModules/excel.py
Outdated
e=UIAHandler.handler.lastFocusedUIAElement | ||
if e and e.cachedAutomationID=="CellEdit": | ||
obj=UIA(UIAElement=e) | ||
obj.parent=api.getFocusObject() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this set to the focus object instead of self? What is the focus object supposed to be? What happens if the parent is'nt overridden at all?
…nt must be set. also increase search count, and only set parent if previous focus was an ExcelCell.
I have tested in Excel 2010 and editing cells still works. |
In office 2016 /365, latest build, it says unknown, when trying to edit / rename the cell
From: Łukasz Golonka <notifications@github.com>
Sent: Monday, February 18, 2019 11:28 AM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: Re: [nvaccess/nvda] Support in-cell editing in Excel 2016/365 (#9290)
I have tested in Excel 2010 and editing cells still works.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#9290 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AKohkxOtNXPF-jYOngSnQlLbC1BCEsXCks5vOoBFgaJpZM4a_9oc> . <https://github.com/notifications/beacon/AKohk4Ko-MG17X1XlqVmPphWiT5ETfWFks5vOoBFgaJpZM4a_9oc.gif>
|
@zstanecic what about if you press f2, alt+tab away and back again. Does
it find the edit control?
Could you please test something for me:
1. Open the NVDA Python console
2. paste the following line into the console and press enter:
```
import UIAHandler; UIAHandler.handler.isUIAWindow=lambda w: True
```
This will force NVDA to use UI automation for everything, including all
of Excel.
3. Now back in Excel, press f2 on a cell.
4. Press NvDA+f1 and paste the dev info for the focused control here.
You will have to restart NVDA to get NVDA's UIA behaviour back to normal.
|
No, it says unknown
From: Michael Curran <notifications@github.com>
Sent: Monday, February 18, 2019 10:59 PM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: zstanecic <zvonimirek222@yandex.com>; Mention <mention@noreply.github.com>
Subject: Re: [nvaccess/nvda] Support in-cell editing in Excel 2016/365 (#9290)
@zstanecic what about if you press f2, alt+tab away and back again. Does
it find the edit control?
Could you please test something for me:
1. Open the NVDA Python console
2. paste the following line into the console and press enter:
```
import UIAHandler; UIAHandler.handler.isUIAWindow=lambda w: True
```
This will force NVDA to use UI automation for everything, including all
of Excel.
3. Now back in Excel, press f2 on a cell.
4. Press NvDA+f1 and paste the dev info for the focused control here.
You will have to restart NVDA to get NVDA's UIA behaviour back to normal.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#9290 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AKohk_xZOfdFbhGu3f78SK98P6S-K_jhks5vOyI-gaJpZM4a_9oc> . <https://github.com/notifications/beacon/AKohky-0U6e5eF4Vs_JWKUf-AcXmFDmPks5vOyI-gaJpZM4a_9oc.gif>
|
Here, it works with Excel 365 version 16.0.11231.20174. However, when I focus the edit cell edit box and than alt+tab out and back in, I get the following output: |
@michaelDCurran: It puzzles me a bit that this is merged while @zstanecic didn't report it was fixed for him. Or am I missing something? There is also the focus ancestry issue I was experiencing when alt+tabbing out and back in. |
@LeonarddeR The issue you reported with the strange focus ancestry is due to the fact that when alt+tabbing back in, you were not originally on a cell, and therefore you are seeing the parent ancestry of the UIA edit control. There is probably some fancy way we could try and detect the current cell from the UIA edit control, but I feel that this scenario is very rare. The common usage will be starting on a cell and typing or pressing f2. |
Actually, there is no way around the focus ancestry thing as it seems that all Excel's object model calls fail while a cell is being edited. So we would never be able to locate the cell. |
Nope, it is ok and I'm happy with the change. I just wanted to make sure that you took the reported issues into account when merging this, and as you did, it is ok. :) |
Link to issue number:
Fixes #8146
Summary of the issue:
In Excel 2010 and below, NVDA would use its displayModel code to interact with the formula / cell edit control.
Excel 2013 introduced UI Automation support for the edit control.
However, in Excel 2016/365 it seems that the UI Automation element for the in-cell edit control is a child of the active cell, and therefore uses the window handle for the sheet, rather than the specific EXCEL6 in-cell edit window.
But because we ignore UI Automation in the EXCEL7 (sheet) window, all we get now is a generic MSAA client object in the EXCEL6 window with focus. In short, NVDA just says "unknown" and the edit control is not usable.
Turning off in-cell editing in Excel's options allows NVDA to interact with the edit control properly as the window handle for the edit control will be "EXCEL<" not "EXCEL7". But this is just a work-around and many users do not know to do this.
Description of how this pull request fixes the issue:
Provide an EXCEL6 NVDAObject overlay class in the Excel appModule, which if inaccessible redirects focus to the UIA element for the in-cell edit control if available.
Testing performed:
In a sheet with in-cell editing turned on: pressed f2 and confirmed that NVDA announced the edit control and that the arrow keys allowed navigating the text.
Then with in-cell editing turned off, pressed f2 and confirmed that NVDA still announced the edit control and that the arrow keys could navigate the edit control.
Performed the above 2 tests but this time rather than pressing f2, simply started typing in the cell.
Testing on Excel 2010 is still required.
Known issues with pull request:
None.
Change log entry:
Bug fixes: