Voice activation software to run macros?

TedX

Board Regular
Joined
Apr 18, 2021
Messages
122
Office Version
  1. 365
Platform
  1. Windows
One of the reasons I like creating macros to speed things along in Excel is that I'm lazy. I assume I am not alone in that department 🤪

So my question is, is there any voice activation software around (even in Beta) that would let me say commands that would run macros?
 
Ah Ha, you gave me a lead regarding debugging, so here is where the error actually occurs:

View attachment 80530

Can anyone see why this is throwing an error?

1670609691676.png


It's a Run-time error '1004'. I can manually run a macro named 'one', what would stop the code from being able to run it? Any suggestions? 🙏
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Do you still have two Sub One() routines (modules 148 and 149?)?
 
Upvote 0
Do you still have two Sub One() routines (modules 148 and 149?)?
Yes I do 148 is a sample macro called one that just colours a few cells in. 149 is where I've put the InitVoiceListener and MsgBox. What are you thinking Dan_W?

1670635581481.png
 
Upvote 0
Im thinking that's the source of your error. As I mentioned in my previous message, you should avoid subroutines of the same name because VBA won't know which one you want it to run
 
Upvote 0
Solution
Im thinking that's the source of your error. As I mentioned in my previous message, you should avoid subroutines of the same name because VBA won't know which one you want it to run

Of course, the MsgBox is the problem, I only put that in because the code from the original tutorial had it in, I guess to just act as proof that something happened. It worked, it 100% worked, this is the part coming up where I thank you blubbering and spluttering like a baby 🤣😂🤣 This has been a marathon and there are many who have helped along the way. I guess the fact that I'm so thick, actually expanded this thread far longer than it need to be. Which is good because there must be other dopey people like me out there. Yes you did say the issue earlier and what's more relevant is that you came back a second time and said it again. I wasn't thinking the MsgBox reference was actually a subroutine in its own right, I was thinking it's just a reference to my one and only macro of that name but as you have driven home to me, there were actually two macros of the same name. Who would have ever thunk it 😁 So with the greatest of pleasure I'm going to mark this thread solved, I learned a lot, and it was the little things, like Class Modules are different to Standard Modules (LOL) and make sure every macro has only one unique name. I learned not to call your macros long-winded descriptive names like Sub I_will_never_call_a_macro_this_lengthy_name_ever_again()

I want to thank *MCLIFTO8, alexofrhodes, Dan_W and Jaafar Tribak you all helped heaps, thank you very much!

1670637257961.png
 
Last edited:
Upvote 0
You're very welcome. I was curious to hear what you thought of the speech recognition system. Do please report back if you end up coming up with a suggested way of using it, etc.
 
Upvote 0
You're very welcome. I was curious to hear what you thought of the speech recognition system. Do please report back if you end up coming up with a suggested way of using it, etc.

Absolutely Dan_W, you can't get rid of me easily, now that I've had a taste of this 😉
Plus, I am now a Board Regular 🤪 pity anyone I try to help 😂:ROFLMAO::ROFLMAO:
 
Upvote 0
Hi again (yep it's me), I just can't get the second case to work (see image) I called it three, in fact I can't even find three when I search for it but I can step into it to make it work. Is this a syntax problem or a naming convention issue or just me being dumb?

1670729241380.png
 

Attachments

  • 1670728288545.png
    1670728288545.png
    70.7 KB · Views: 5
Upvote 0
Well, on the plus side, it's not a syntax problem - you wouldn't be left with any doubt if it were. VBA is pretty quick to tell you about syntax issues.

It's hard to say without having a clearer understanding of the how the project is laid out - I assume that the the module on the left is a class module, and the middle and right ones are standard modules? On that, your module names (148 and 149) are starting to give me panic attacks at just how big your VBProject is.
I called it three, in fact I can't even find three when I search for it but I can step into it to make it work.
I suspect that this the answer to your problems somehow - I'm not entirely sure what you mean when you say you search for it but you can't find it... Do you mean you search for it with the Macros Dialog Box (Alt F8) or you literally can't find the string "three" in the Find Dialog Box?
 
Upvote 0
Well, on the plus side, it's not a syntax problem - you wouldn't be left with any doubt if it were. VBA is pretty quick to tell you about syntax issues.

It's hard to say without having a clearer understanding of the how the project is laid out - I assume that the the module on the left is a class module, and the middle and right ones are standard modules? On that, your module names (148 and 149) are starting to give me panic attacks at just how big your VBProject is.

I suspect that this the answer to your problems somehow - I'm not entirely sure what you mean when you say you search for it but you can't find it... Do you mean you search for it with the Macros Dialog Box (Alt F8) or you literally can't find the string "three" in the Find Dialog Box?

That's correct, I can't find the subroutine named 'three', but I can run it by stepping through it. Weird hey? I have been working on this program for three years and have 149 modules, there are several hundred macros. I did redesign the whole thing several times. I know what you're thinking, I should have just started again and built a new project and that way would only have a much smaller number of macros. However, all names are unique, there is no 'three', except there is.

Just on the code in the Class Module, is the case set out correctly?
 
Upvote 0

Forum statistics

Threads
1,224,945
Messages
6,181,937
Members
453,074
Latest member
JefersonKollet

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top