I tried to adapt VBA examples from How do you get Excel to refresh data on sheet from within VBA?, they do not work: sheet.Calculate does nothing, other versions of calculate cannot be found...
Asked
Active
Viewed 541 times
0
-
What do you mean by calculate? Recalculate the formulas? – Ben Mordecai Feb 08 '13 at 16:16
-
yes, calculate the results of the formulas (equivalent of F9) – Yulia V Feb 08 '13 at 16:18
-
http://stackoverflow.com/questions/4198365/facing-problem-with-xlwt-and-xlrd-reading-and-writing-simultaneously – Ben Mordecai Feb 08 '13 at 16:20
-
what do you think about my answer below? – Yulia V Feb 08 '13 at 16:35
-
I don't know, I've only ever used the xlrd module. – Ben Mordecai Feb 08 '13 at 17:44
1 Answers
0
Adding a CalculateFull macro progrmmatically and calling it solves the problem, but looks convolutive ...
xlmodule = book.VBProject.VBComponents.Add(1) # http://support.microsoft.com/kb/282830 if this line throws an error
xlmodule.CodeModule.AddFromString('Public Sub AnotherCalculateFull() \n\
Application.CalculateFull \n\
End Sub')

Yulia V
- 3,507
- 10
- 31
- 64