Help! Time Looped Macros

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Hello. I got this from the board from a guy named COLO. Run it on your computer and tells you all code numbers for your toolbars.
When you get the code (For the stock button) reply with it and I will show you how to click it every 8 mins. Cheers


Sub GetFindControlID() 'gift for you
'How to find FindControl ID for FindControl Execute??
Dim a As CommandBarControls, b As Object
Set a = Application.CommandBars.FindControls
[A1].Resize(, 2).Value = Array("Caption", "ID")
For Each b In a
With [A65536].End(xlUp).Offset(1)
.Value = b.Caption
.Offset(, 1).Value = b.ID
End With
Next
Set a = Nothing
End Sub

Sub Test()
'Put ID instead of 899
Application.CommandBars.FindControl(ID:=899).Execute
End Sub
 
Upvote 0
:oops:

Ok, I think I get what you mean, The number next to the "Update Quotes" cell is 1, but there are many other 1s also? How can this be a unique identifier?
 
Upvote 0
This should work,

Sub Test()
Application.CommandBars.FindControl(ID:=1).Execute
End Sub

Let me know?

also do you need a hand with the 8 min loop or have you got that sorted
 
Upvote 0
That macro opens up another menu for another plugin i have.

Would it be easier to just do this through the menu as it is also possible to achieve the same result by going to Data -> Stock Quotes from MSN Money -> Update Quotes.

Would that be easier than a button on the toolbar?
 
Upvote 0
Here we go

first of all in VBA double click on this workbook (It appears under the sheets, above the forms and macros.


and input this

Private Sub Workbook_Open()
Reset
End Sub


then in a module stick

Sub Reset()
Static SchedSave
If SchedSave <> 0 Then
On Error Resume Next
Application.OnTime SchedSave, "stick your macro name here", , False
End If
SchedSave = Now + TimeValue("00:08:00") ' 8 minutes
Application.OnTime SchedSave, "stick your macro name here", , True
End Sub


Obviously replace where ive wrote stick your macro here with the name of your macro which contains the
Application.CommandBars.FindControl(ID:=1).Execute
code. ie macro1

This should work

Cheers
 
Upvote 0
OK give me the shortcuts you would use to get to
Data -> Stock Quotes from MSN Money -> Update Quotes.

ie
ALT D brings up the data drop down

( I need to know each letter shortcut to the end )

Still use the code above for the 8 minute increments we just need to change the macro that this call.
 
Upvote 0
The issue is that the macro is not correct. When it executes, all it does is open a menu in Excel for a different plugin. When I ran the macro that extracted the identifiers, it returned MANY 1s.

Here is what I got and they are all buttons for the same plugin. There are many more 1s as well for other things.


Insert Stock &Quotes 1
&Cancel Update 1
&Update Quotes 1
&More Information about Stocks 1
Help 1


I need : &Update Quotes
 
Upvote 0
OK diqbal

we will go about it another way if you get me the shortcuts to

Data -> Stock Quotes from MSN Money -> Update Quotes.

ie
ALT D brings up the data drop down

we can do it through this route

Cheers
 
Upvote 0

Forum statistics

Threads
1,215,218
Messages
6,123,676
Members
449,116
Latest member
HypnoFant

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