Go Back   TechArena Community > Software > Windows Software
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Need macro in excel to refresh the screen

Windows Software


Reply
 
Thread Tools Search this Thread
  #1  
Old 24-06-2009
Member
 
Join Date: May 2008
Posts: 24
Need macro in excel to refresh the screen
  

Hi,

I have an excel worksheet bound to a database. Now on a particular phase or time I want macro in excel to refresh the data when I open the excel file.
If anyone of you doing this please let me know.

Thanks in advance.

Reply With Quote
  #2  
Old 24-06-2009
Member
 
Join Date: May 2008
Posts: 42
Re: Need macro in excel to refresh the screen

What do you have in back end? I mean where is your database?
I consider its access. You need to first have a copy of your data. Now try working on it.
If you have connect Excel with Access then you just need a command to refresh the screen & fetch the values from the access database.
I have already written a macro that updates the database But the only problem with me is that I need to instruct the macro to run each time.
I am looking for a screen refresh that will automatically refresh the excel workbook at a given interval of time.
Please help me guys.
Reply With Quote
  #3  
Old 24-06-2009
Member
 
Join Date: May 2008
Posts: 29
Re: Need macro in excel to refresh the screen

There is no need to write any code for this. Excel pivot tables have an option to auto refresh when the spreadsheet opens. All you need is to check the box and you are done.
But if u need MACROS try this what I found:
Code:
' General Declarations
Public RunWhen As Double
Public Const cRunIntervalSeconds = 60 ' seconds between updates
Public Const cRunWhat = "UpdateLinks" ' name of procedure to run
Public Toggle As Double

' Ensure Timer Starts when Workbook is opened
'
Private Sub Auto_Open()
Call StartTimer
End Sub

Sub StartTimer()

RunWhen = Now + TimeSerial(0, 0, cRunIntervalQuick)
Application.OnTime EarliestTime:=RunWhen, Procedure:=cRunWhat, Schedule:=True
End Sub

Sub UpdateLinks()
'
' Update data from external files
'
Application.ScreenUpdating = False
ActiveWorkbook.UpdateLink Name:= _
"\\SPREADSHEET PATH AND NAME.xls", Type:= xlExcelLinks
Application.ScreenUpdating = True
End Sub
Reply With Quote
  #4  
Old 24-06-2009
Member
 
Join Date: May 2008
Posts: 32
Re: Need macro in excel to refresh the screen

IF its external data
1. If "External Data" tool bar is not visible in your menu bar,
select it by View - Toolbar
2. External data - select "Data Range Properties" icon
3. When the dialog box opens, under "Refresh Control" select refresh frequency.

This is quite simple its solves the purpose why you want a Macro?
Reply With Quote
Reply

  TechArena Community > Software > Windows Software
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Need macro in excel to refresh the screen"
Thread Thread Starter Forum Replies Last Post
Excel 2003 Macro doesn't work in Excel 2007 jjaw Windows Software 3 03-01-2014 02:28 PM
How to use Excel Macro aSITA Windows Software 5 12-02-2011 09:34 PM
What is a Macro that is used in MS Excel? Common Windows Software 5 19-03-2010 02:08 AM
Macro to Add Columns in Excel geokilla Windows Software 3 15-10-2009 01:40 PM
How to create a macro in Excel Bhadrak Windows Software 3 06-05-2009 03:13 PM


All times are GMT +5.5. The time now is 10:42 PM.