KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Any Excel programming tips?
Topic Summary: To facilitate Dragon Natural Language usage?
Created On: 08/07/2020 09:37 AM
Status: Post and Reply
Linear : Threading : Single : Branch
 Any Excel programming tips?   - DigitalCyclist - 08/07/2020 09:37 AM  
 Click quote Any Excel programming tips?   - Lunis Orcutt - 08/07/2020 01:59 PM  
 Click quote Any Excel programming tips?   - DigitalCyclist - 08/08/2020 09:47 AM  
 Any Excel programming tips?   - Lunis Orcutt - 08/08/2020 03:50 PM  
 Any Excel programming tips?   - DigitalCyclist - 08/10/2020 04:16 PM  
 Any Excel programming tips?   - Alan Cantor - 08/10/2020 10:23 PM  
 Any Excel programming tips?   - DigitalCyclist - 08/11/2020 09:21 AM  
 Any Excel programming tips?   - DigitalCyclist - 08/11/2020 05:02 PM  
 Any Excel programming tips?   - Edgar - 08/12/2020 11:21 AM  
 Any Excel programming tips?   - DigitalCyclist - 08/12/2020 11:38 AM  
Keyword
 08/07/2020 09:37 AM
User is offline View Users Profile Print this message

Author Icon
DigitalCyclist
Power Member

Posts: 49
Joined: 01/07/2018

Does anyone have any tips for programming Excel worksheet function so that Dragon's commands will work better with it? In particular, I'd like Dragon to be able to recognize my programmed buttons so that I can say, "click Button" and have it work. In programming the buttons, are there any specific properties that can be set so that Dragon recognizes the objects?


In lieu of this capability I use Speechstart+ "show flags" which then flags each of the buttons, allowing me to click a button by acting on the flag. In complex spreadsheet apps, it would be much preferable to just be able to speak "click ThisButton" or "click ThatButton".


(And yes, I do have Dragon Natural Language enabled in settings.)

Thanks.



 08/07/2020 01:59 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 37853
Joined: 10/01/2006

Assuming you remember to launch Excel after Dragon and can see the green • in the DragonBar, you should be able to click any menu or button by saying click <menu/button name>; referred to as Active Accessibility. You shouldn't need to create personal commands but if necessary, this can be handled by our new simplified version of VerbalBasic II, which allows you to verbally create commands directly into Dragon. This technology is approximately 20 times faster than typing; based on WYSWYS (What You See Is What You Say). VerbalBasic II has also passed been Trump Test Certification (if Donald can do it, so can you) which was conducted by our partner who used to ride the short bus to school. Best of all, you only have to learn one command which is New Script <dictation>. Note that in the last 12 hours, we have added the ability to hands-free create application specific commands. You are no longer limited to global commands. Please keep in mind that this is a moving target which we have not finished but hope to complete this weekend. Dragon VB II will be accompanied by user guide which is currently only one sentence but we hope to expand to nearly half a page. 



-------------------------

Forum Mission Statement
Trial Downloads
Dragon/Sales@KnowBrainer.com 
(615) 884-4558 ext 1

 08/08/2020 09:47 AM
User is offline View Users Profile Print this message

Author Icon
DigitalCyclist
Power Member

Posts: 49
Joined: 01/07/2018

Thanks, Lunis.

I'm running DPG 15.6 and the PC-resident/subscription installation of Microsoft 365 for Excel. The Dragon add-in is loaded and running in Excel. With Excel worksheets loaded, the green "active accessibility" light is on in DragonBar.

All the other Dragon navigation and other commands work within the spreadsheet (eg "cell R1C1", "edit cell").

However, "click MyButton" simply results in that text being inserted into whichever cell happens to be the active one. Again though, Speechstart+'s "show flags" correctly identifies and flags each actionable button.

Any other troubleshooting clues?
Thanks.



 08/08/2020 03:50 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 37853
Joined: 10/01/2006

If this helps, we just finished testing Excel menus, various controls and manufacturer buttons that are included in submenus with success. If we understand correctly, you should have this capability. We are both using DPG 15.6



-------------------------

Forum Mission Statement
Trial Downloads
Dragon/Sales@KnowBrainer.com 
(615) 884-4558 ext 1



 08/10/2020 04:16 PM
User is offline View Users Profile Print this message

Author Icon
DigitalCyclist
Power Member

Posts: 49
Joined: 01/07/2018

Thanks for the return message. All of the native Excel buttons, menu items, dialogue choices etc. work fine. It's only buttons that I create myself in developer mode that aren't being recognized. I will continue to experiment…

 08/10/2020 10:23 PM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 3819
Joined: 12/08/2007

I have only a little experience with VBA in Excel, and I have not had an opportunity to create buttons.

But when creating a button, isn't "accelerator" one of the properties you can set? If it is, what happens if you choose "z" (or another letter than won't conflict with the built-in accelerators for ribbons: "F" for File, "H" for Home, etc.)

If you set the accelerator this way, does pressing Alt + z activate the button? If yes, this Dragon script should do the same:

Sub Main
SendSystemKeys "{Alt+z}"
End Sub



 08/11/2020 09:21 AM
User is offline View Users Profile Print this message

Author Icon
DigitalCyclist
Power Member

Posts: 49
Joined: 01/07/2018

Thanks, Alan – that's a really creative work-around! That would definitely work, yet in practice would be quite unwieldy when I have many Excel applications, many with dozens of programmed buttons.

 08/11/2020 05:02 PM
User is offline View Users Profile Print this message

Author Icon
DigitalCyclist
Power Member

Posts: 49
Joined: 01/07/2018

I did some experimentation and assigning an accelerator does help in some cases. In a test spreadsheet, I assigned the accelerator "B" to a program button labelled "Books". The button appearance then changes to "Books". Then I can say "press All B" and the "Books" button is clicked. That's a lot easier than "show flags" followed by the flag number. For a large spreadsheet with a lot of buttons, it would get onerous and confusing to try and assign unique accelerators though.

 08/12/2020 11:21 AM
User is offline View Users Profile Print this message

Author Icon
Edgar
Top-Tier Member

Posts: 875
Joined: 04/03/2009

I'm learning a lot about accelerator keys. For Menu items they only need to be unique to the submenu* not the entire menu structure. For label/text field pairs the text field must follow the label immediately in the TAB sequence.

I suspect that if any given Excel project has multiple sheets button accelerators need only be unique to the sheet.

I use Excel itself to help manage the accelerators in applications I write. I create a spreadsheet with three columns: the first contains the entire string of all potentially accelerated controls; the second contains all assigned accelerators; the third is a working column which contains most obvious unassigned accelerators.

I create the third column by sorting the entire sheet on the second column then going through the alphabet looking for letters that are missing in the second column. This leaves all of the strings without accelerators sorted out. I go through these and assign any of the letters from the third column which are usable. Occasionally I will need to change original assignments to something that is available in the third column freeing up a rarely-used letter better used elsewhere. I can also modify the original strings’ wording to include an unassigned character (this sometimes leads to unwieldy strings - I recently had a button labeled "Grid Font" and another labeled "Interface Font" in a very busy preferences dialog; I ended up changing the second two "Just Interface Font" with the <J> in "Just" as the accelerator. Don't forget, you can use punctuation, numbers and "special" keys (?, brackets, and other "shifted top row" keys - ~, !, $ etc.).

*Menu accelerators don't always need to be unique. On your primary menu you could have primary menu items like: "&File", "&Edit", "&Functions"… thus you have two (or even more) items with the same (<f>) accelerator. You start out by saying "press alt" - all the accelerators are underlined; the next say "press foxtrot" - the File menu drops open; you again say "press foxtrot" - the Functions menu drops open. You might get away with a single line script:

SendKeys "%ff", 1

or you might need:

SendKeys "%f", 1

' depending on how long the menu is and how long it takes

' your computer to deploy it, you might need a:

'Wait 0.1

SendKeys "f", 1



-------------------------

-Edgar
DPI 15.3, 64-bit Windows 10 Pro, OpenOffice & Word 365, Norton Security, Shure X2U XLR to USB mic adapter with Audio Technica DB135 vocal mic, Asus X299-Deluxe Prime, Intel Core i9-7940X (14 core, 4.3 GHz overclocked to 4.9 GHz), G.SKILL TridentZ Series 64GB (4 x 16GB) DDR4 3333 (PC4 26600) F4-3333C16Q-64GTZ, NVIDIA GIGABYTE GeForce GTX 1060 GV-N1060G1 GAMING-6GD REV 2.0 6GB graphics card

 08/12/2020 11:38 AM
User is offline View Users Profile Print this message

Author Icon
DigitalCyclist
Power Member

Posts: 49
Joined: 01/07/2018

Thanks, Edgar. Beyond simply assigning an accelerator key to a program button, I've learned a lot about Excel's accelerator capability as well. One nice behaviour is that accelerator is assigned to program buttons take precedence over Excel's own accelerators assigned to menu items in the ribbon. In most of my Excel apps I hide the ribbon anyway; however, this precedence is useful when working in developer mode.

Per my previous comment, I'm finding that with a simple worksheet with just a few programmed buttons, assigning accelerators works quite well. It's quite convenient to simply say "press alt <accelerator key >". No Dragon command scripting is needed and would just add more complexity, especially when multiple worksheets in multiple workbooks are considered.

Good discussion, folks. Thank you.

Statistics
31740 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 1 users logged in.
The most users ever online was 12124 on 09/09/2020 at 04:59 AM.
There are currently 652 guests browsing this forum, which makes a total of 653 users using this forum.

FuseTalk Standard Edition v4.0 - © 1999-2020 FuseTalk™ Inc. All rights reserved.