Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calculation issue
Using Excel 2007
I have two macros: one that gets data from an external source and the other that takes information from excel and creates PDF's. If I run each macro individually, I get the right results. If I call the macro that creates the PDF's from the macro that gets the data (the pdf's have not been updated with the new information). The workbook is on automatic calculation mode. I've have tried adding the lines Application.Calculatefull Application.Wait Now + timevalue("00:00:03") in the first macro before calling the second macro - (with no success) any suggestions? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calculation issue
Try switching off Auto Calculation and calculating them in the order that you
want them done, for example:- Public Sub MyCalculate() Dim sh As Worksheet Application.Calculation = xlCalculationManual For Each sh In Workbooks("SourceData").Worksheets sh.Calculate Next sh For Each sh In Workbooks("PDFData").Worksheets sh.Calculate Next sh Application.Calculation = xlCalculationAutomatic End Sub -- Alan Moseley IT Consultancy http://www.amitc.co.uk If I have solved your problem, please click Yes below. Thanks. "Brad" wrote: Using Excel 2007 I have two macros: one that gets data from an external source and the other that takes information from excel and creates PDF's. If I run each macro individually, I get the right results. If I call the macro that creates the PDF's from the macro that gets the data (the pdf's have not been updated with the new information). The workbook is on automatic calculation mode. I've have tried adding the lines Application.Calculatefull Application.Wait Now + timevalue("00:00:03") in the first macro before calling the second macro - (with no success) any suggestions? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calculation issue
Just to be sure that the application responds to the CalculateFull, try
inserting a DoEvents immediately following the Application.CalculateFull -- Gary''s Student - gsnu200811 "Brad" wrote: Using Excel 2007 I have two macros: one that gets data from an external source and the other that takes information from excel and creates PDF's. If I run each macro individually, I get the right results. If I call the macro that creates the PDF's from the macro that gets the data (the pdf's have not been updated with the new information). The workbook is on automatic calculation mode. I've have tried adding the lines Application.Calculatefull Application.Wait Now + timevalue("00:00:03") in the first macro before calling the second macro - (with no success) any suggestions? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calculation issue
I found out that I needed to change
..BackgroundQuery = True ..BackgroundQuery = False To make it work.... One day, thanks for your help. -- Wag more, bark less "Gary''s Student" wrote: Just to be sure that the application responds to the CalculateFull, try inserting a DoEvents immediately following the Application.CalculateFull -- Gary''s Student - gsnu200811 "Brad" wrote: Using Excel 2007 I have two macros: one that gets data from an external source and the other that takes information from excel and creates PDF's. If I run each macro individually, I get the right results. If I call the macro that creates the PDF's from the macro that gets the data (the pdf's have not been updated with the new information). The workbook is on automatic calculation mode. I've have tried adding the lines Application.Calculatefull Application.Wait Now + timevalue("00:00:03") in the first macro before calling the second macro - (with no success) any suggestions? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calculation issue
Tried your method and it didn't work, found out that changing the following
..BackgroundQuery = True to ..BackgroundQuery = False Worked.... One day I'll get it, thanks for your help. -- Wag more, bark less -- Wag more, bark less "Alan Moseley" wrote: Try switching off Auto Calculation and calculating them in the order that you want them done, for example:- Public Sub MyCalculate() Dim sh As Worksheet Application.Calculation = xlCalculationManual For Each sh In Workbooks("SourceData").Worksheets sh.Calculate Next sh For Each sh In Workbooks("PDFData").Worksheets sh.Calculate Next sh Application.Calculation = xlCalculationAutomatic End Sub -- Alan Moseley IT Consultancy http://www.amitc.co.uk If I have solved your problem, please click Yes below. Thanks. "Brad" wrote: Using Excel 2007 I have two macros: one that gets data from an external source and the other that takes information from excel and creates PDF's. If I run each macro individually, I get the right results. If I call the macro that creates the PDF's from the macro that gets the data (the pdf's have not been updated with the new information). The workbook is on automatic calculation mode. I've have tried adding the lines Application.Calculatefull Application.Wait Now + timevalue("00:00:03") in the first macro before calling the second macro - (with no success) any suggestions? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Strange Calculation issue | Excel Discussion (Misc queries) | |||
calculation issue? | Excel Discussion (Misc queries) | |||
Calculation speed issue | Excel Discussion (Misc queries) | |||
Vlookup Calculation Issue | Excel Worksheet Functions | |||
Excel Calculation Issue | Excel Programming |