Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Causing all calculated cells to refresh...

Hi,

I'm new to Excel programming. I need to cause all the Workbook to refresh
the calculated cells when de document is opened. I tryed the following.

Private Sub Workbook_Open()

MsgBox "STARTING"
Me.RefreshAll

End Sub

The message box appears as expected, but the Me.RefreshAll doesn't works.
What should I do?
In which order the cells are refreshed?

Thanks in advance
Faustino


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 968
Default Causing all calculated cells to refresh...

Hi Faustino,

Assuming refresh=recalculate then
If the workbook is in automatic calculation mode then it will recalculate
when it is opened anyway.
(Tools--Options--calculation)
If it is in Manual node then instead of refreshall use
Application.Calculate


hth
Charles
______________________
Decision Models
The Excel Calculation Site
www.DecisionModels.com

"faustino Dina" wrote in message
...
Hi,

I'm new to Excel programming. I need to cause all the Workbook to refresh
the calculated cells when de document is opened. I tryed the following.

Private Sub Workbook_Open()

MsgBox "STARTING"
Me.RefreshAll

End Sub

The message box appears as expected, but the Me.RefreshAll doesn't works.
What should I do?
In which order the cells are refreshed?

Thanks in advance
Faustino




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Causing all calculated cells to refresh...

Thanks for your replay.

Assuming refresh=recalculate then
If the workbook is in automatic calculation mode then it will recalculate
when it is opened anyway.
(Tools--Options--calculation)
If it is in Manual node then instead of refreshall use
Application.Calculate


I tryed Application.Calculate but it didn't work as I expect.
The workbook is in Automatic mode. I have some functions in a dll that
display the values extracted from a database into the cells taking as
arguments values from other cells. It works as expected. Whenever I change
an argument cell, the calculated field calls my dll function and refresh the
value in the cell. The problem is that when the document is closed, it saves
the last results from the calculated fields. Then when it is opened again it
shows the saved values. It doesn't call the function until I change manually
the cells that act as argument. But I need all the calculated cell to be
recalculated to rerieve the current values from the database.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 968
Default Causing all calculated cells to refresh...

Application.calculatefull would be more efficient. There is no need to
rebuild the dependency tree.

or you could consider making your functions volatile (Application.Volatile).
Volatile functions are recalculated at each calculation even if their input
arguments do not change.

Charles
______________________
Decision Models
The Excel Calculation Site
www.DecisionModels.com

"faustino Dina" wrote in message
...
It works:
Application.Worksheets(1).Range("B1").Calculate 'To recalculate a
specific range
Application.CalculateFullRebuild 'To
recalculate all the document


"faustino Dina" wrote in message
...
Thanks for your replay.

Assuming refresh=recalculate then
If the workbook is in automatic calculation mode then it will

recalculate
when it is opened anyway.
(Tools--Options--calculation)
If it is in Manual node then instead of refreshall use
Application.Calculate


I tryed Application.Calculate but it didn't work as I expect.
The workbook is in Automatic mode. I have some functions in a dll that
display the values extracted from a database into the cells taking as
arguments values from other cells. It works as expected. Whenever I

change
an argument cell, the calculated field calls my dll function and refresh

the
value in the cell. The problem is that when the document is closed, it

saves
the last results from the calculated fields. Then when it is opened

again
it
shows the saved values. It doesn't call the function until I change

manually
the cells that act as argument. But I need all the calculated cell to be
recalculated to rerieve the current values from the database.






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compatibility alert - can't find cells causing problem odp Excel Discussion (Misc queries) 0 May 12th 09 02:50 AM
zero value cells/blank cells causing error in AVERAGE? LilBeanie1033 Excel Worksheet Functions 5 March 19th 09 06:39 PM
Deleting cells from chart source data, causing problems Caeres Excel Discussion (Misc queries) 0 October 3rd 08 05:23 PM
cells without values causing error message karen Excel Discussion (Misc queries) 6 January 11th 08 06:39 PM
Pivot Table refresh and calculated item disabled GPO Excel Discussion (Misc queries) 0 August 12th 07 06:04 AM


All times are GMT +1. The time now is 10:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"