Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Compatibility alert - can't find cells causing problem | Excel Discussion (Misc queries) | |||
zero value cells/blank cells causing error in AVERAGE? | Excel Worksheet Functions | |||
Deleting cells from chart source data, causing problems | Excel Discussion (Misc queries) | |||
cells without values causing error message | Excel Discussion (Misc queries) | |||
Pivot Table refresh and calculated item disabled | Excel Discussion (Misc queries) |