Automatically Update Spreadsheet every 5 Minutes

dminkel

New Member
Joined
Oct 20, 2006
Messages
11
Here at work we have an Excel spreadsheet that pulls information from a different program and puts it into specific cells on that worksheet.
Currently we have to push "F9" to get the spreadsheet to update and reflect the numbers that are on the other program. Is there a macro or formula that can be written so that the spreadsheet will automatically update every 5 or 10 minutes on its own? Any help will be greatly appreciated.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hi -
Welcome to the board.
one option;
Code:
Sub startme()
Application.OnTime Now + TimeValue("00:00:05"), "my_program" 'calculate every 5 seconds change to suit
End Sub
Sub my_program()
Application.SendKeys "{F9}"
startme
End Sub
 
Upvote 0
Being Veeerrrryyyy New to this, is there a code I could just copy and paste in the workbook (where you right click on the sheet tab and then click on view code) that would do the equivalent of hitting "F9" every 5 seconds while the workbook is open?
I copied and pasted this:
Sub startme()
Application.OnTime Now + TimeValue("00:00:05"), "my_program" 'calculate every 5 seconds change to suit
End Sub
Sub my_program()
Application.SendKeys "{F9}"
startme
End Sub

In my workbook but it did not update anything for me......I just need something that I can stick in there that will do the same thing as hitting "F9"
 
Upvote 0
Well, the error message involves the "my_program" part of it. Should it not just say something like "this workbook" or "this spreadsheet". And my apologies....I won't have the time to read the link to the useful information provided for a few days......I was hoping for a quick fix here but do appreciate the input.
 
Upvote 0
Hi -
Welcome to the board.
one option;
Code:
Sub startme()
Application.OnTime Now + TimeValue("00:00:05"), "my_program" 'calculate every 5 seconds change to suit
End Sub
Sub my_program()
Application.SendKeys "{F9}"
startme
End Sub

I am still having issues with the Macro. Once I input the formulat, my original information defaults to #NAME?. What can I do to correct this?

I am trying to get my workbook to update every 5 minutes.
 
Upvote 0

Forum statistics

Threads
1,213,562
Messages
6,114,322
Members
448,564
Latest member
ED38

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