KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Triggering Excel Macro by Voice
Topic Summary:
Created On: 10/24/2021 01:23 AM
Status: Post and Reply
Linear : Threading : Single : Branch
 Triggering Excel Macro by Voice   - Tomc - 10/24/2021 01:23 AM  
 Triggering Excel Macro by Voice   - Matt_Chambers - 10/24/2021 07:52 AM  
 Triggering Excel Macro by Voice   - Alan Cantor - 10/24/2021 10:31 AM  
 Triggering Excel Macro by Voice   - Tomc - 10/24/2021 05:37 PM  
 Triggering Excel Macro by Voice   - Alan Cantor - 10/24/2021 05:45 PM  
 Triggering Excel Macro by Voice   - R. Wilke - 10/24/2021 11:53 AM  
Keyword
 10/24/2021 01:23 AM
User is offline View Users Profile Print this message

Author Icon
Tomc
Junior Member

Posts: 37
Joined: 10/14/2019

Is there a way to write a command that will trigger a specific macro in Microsoft Excel?

 10/24/2021 07:52 AM
User is offline View Users Profile Print this message

Author Icon
Matt_Chambers
Top-Tier Member

Posts: 550
Joined: 08/09/2018

Yes, there is. I don't use Excel much, so don't have an example directly from my files, but I use Word a fair amount, or at least used to, and the code should be almost identical.

You need to include an object reference to the Microsoft Excel Object Library. In the MyCommands Editor, press alt plus enter and then scroll down until you see Microsoft Excel listed, and check that. Then, either paste your VBA code for the macro in question, or alternatively, try this line:

Excel.Application.Run(name of macro in Excel)

Hope this helps.

Matt
 10/24/2021 10:31 AM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 4280
Joined: 12/08/2007

A quick way to voice-enable an Excel macro is to add the macro to the Quick Access Toolbar, and rename the QAT macro to something that Dragon can easily recognize. For example, rename the macro "Hello there".

As long as the macro appears on the QAT, you can activate it by saying "click Hello there".
 10/24/2021 05:37 PM
User is offline View Users Profile Print this message

Author Icon
Tomc
Junior Member

Posts: 37
Joined: 10/14/2019

Thanks. This worked great.  The only problem is that the icon Excel assigns to it is too large. Is there a way to eliminate, change, or shrink the non text part of the icon?

 10/24/2021 05:45 PM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 4280
Joined: 12/08/2007

Not sure which technique you're using, but assuming it's the QAT approach...

 

Excel Options > Quick Access Toolbar

 

If you click the "Modify..." button, you can rename the macro, and you can choose a different icon for the macro. Some icons might be smaller or less conspicuous than the default. But I haven't checked.

 10/24/2021 11:53 AM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7809
Joined: 03/04/2007

Another quick way of doing it is to add a hotkey to the Excel macro, and then execute the hotkey in Dragon via SendKeys; at the cost of spending yet another hotkey. Therefore, I prefer the approach which Matt has outlined.


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



No need to buy if all you want to do is try ...

DragonCapture KB Download (Latest)
DragonCapture Homepage

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

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