Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a two workbooks which are linked together. One field in the master
workbook has a TRUE/FALSE field. Through a link to a similar field on the slave workbook, it controls which set of values are being used. The values are either Financed or NonFinanced. When I run a macro to print either set of values, the macro sets the value in the master to either TRUE or FALSE. Then it prints. The print always seems to be one behind - that even though the valuie was set to TRUE by the macro, the calculated values are for the FALSE setting. And vice-versa if the macro sets it to false - it prints the TRUE version. If you run it the second time - without resetting the TRUE/FALSE, it's fine. I've tried applying Application.Volatile TRUE but it doesn't seeem to be helping. What else can I do to get the workbooks in synch? -- DRK |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is calculation set to automatic? (tools=Options=Calculation tab) Are both
workbooks open when you make the change? Volatile only affects the function which contains the volatile statement - that function is recalculated anytime there is a calculation performed. It doesn't affect other cells, but any cell dependent on that cell (with the volatile function) should get updated if calculation is set to automatic. -- Regards, Tom Ogilvy "DRK" wrote in message ... I have a two workbooks which are linked together. One field in the master workbook has a TRUE/FALSE field. Through a link to a similar field on the slave workbook, it controls which set of values are being used. The values are either Financed or NonFinanced. When I run a macro to print either set of values, the macro sets the value in the master to either TRUE or FALSE. Then it prints. The print always seems to be one behind - that even though the valuie was set to TRUE by the macro, the calculated values are for the FALSE setting. And vice-versa if the macro sets it to false - it prints the TRUE version. If you run it the second time - without resetting the TRUE/FALSE, it's fine. I've tried applying Application.Volatile TRUE but it doesn't seeem to be helping. What else can I do to get the workbooks in synch? -- DRK |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
maybe add this code between the subs to the beginning of the print macro
Sub Update_Links() ActiveSheet.Unprotect ActiveWorkbook.UpdateLink Name:="Your_workbook_name.xls", _ Type:=xlExcelLinks ActiveSheet.Protect DrawingObjects:=True, contents:=True, Scenarios:=True End Sub -- Gary "DRK" wrote in message ... I have a two workbooks which are linked together. One field in the master workbook has a TRUE/FALSE field. Through a link to a similar field on the slave workbook, it controls which set of values are being used. The values are either Financed or NonFinanced. When I run a macro to print either set of values, the macro sets the value in the master to either TRUE or FALSE. Then it prints. The print always seems to be one behind - that even though the valuie was set to TRUE by the macro, the calculated values are for the FALSE setting. And vice-versa if the macro sets it to false - it prints the TRUE version. If you run it the second time - without resetting the TRUE/FALSE, it's fine. I've tried applying Application.Volatile TRUE but it doesn't seeem to be helping. What else can I do to get the workbooks in synch? -- DRK |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Calculation is set to automatic. These are rather large workbooks and it does
take a few seconds to see the changes. Maybe I should tell to wait a few seconds before printing? -- DRK "Tom Ogilvy" wrote: Is calculation set to automatic? (tools=Options=Calculation tab) Are both workbooks open when you make the change? Volatile only affects the function which contains the volatile statement - that function is recalculated anytime there is a calculation performed. It doesn't affect other cells, but any cell dependent on that cell (with the volatile function) should get updated if calculation is set to automatic. -- Regards, Tom Ogilvy "DRK" wrote in message ... I have a two workbooks which are linked together. One field in the master workbook has a TRUE/FALSE field. Through a link to a similar field on the slave workbook, it controls which set of values are being used. The values are either Financed or NonFinanced. When I run a macro to print either set of values, the macro sets the value in the master to either TRUE or FALSE. Then it prints. The print always seems to be one behind - that even though the valuie was set to TRUE by the macro, the calculated values are for the FALSE setting. And vice-versa if the macro sets it to false - it prints the TRUE version. If you run it the second time - without resetting the TRUE/FALSE, it's fine. I've tried applying Application.Volatile TRUE but it doesn't seeem to be helping. What else can I do to get the workbooks in synch? -- DRK |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
putting in a calculate statement and using OnTime to inject a delay may be
useful if you are having problems. Chip Pearson's page on OnTime http://www.cpearson.com/excel/ontime.htm -- Regards, Tom Ogilvy "DRK" wrote in message ... Calculation is set to automatic. These are rather large workbooks and it does take a few seconds to see the changes. Maybe I should tell to wait a few seconds before printing? -- DRK "Tom Ogilvy" wrote: Is calculation set to automatic? (tools=Options=Calculation tab) Are both workbooks open when you make the change? Volatile only affects the function which contains the volatile statement - that function is recalculated anytime there is a calculation performed. It doesn't affect other cells, but any cell dependent on that cell (with the volatile function) should get updated if calculation is set to automatic. -- Regards, Tom Ogilvy "DRK" wrote in message ... I have a two workbooks which are linked together. One field in the master workbook has a TRUE/FALSE field. Through a link to a similar field on the slave workbook, it controls which set of values are being used. The values are either Financed or NonFinanced. When I run a macro to print either set of values, the macro sets the value in the master to either TRUE or FALSE. Then it prints. The print always seems to be one behind - that even though the valuie was set to TRUE by the macro, the calculated values are for the FALSE setting. And vice-versa if the macro sets it to false - it prints the TRUE version. If you run it the second time - without resetting the TRUE/FALSE, it's fine. I've tried applying Application.Volatile TRUE but it doesn't seeem to be helping. What else can I do to get the workbooks in synch? -- DRK |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I ended up using Wait for 10 seconds. Seems to give it enough time to
contemplate the Meaning of Life and produce correct numbers. Thanks for your help -- DRK "Tom Ogilvy" wrote: putting in a calculate statement and using OnTime to inject a delay may be useful if you are having problems. Chip Pearson's page on OnTime http://www.cpearson.com/excel/ontime.htm -- Regards, Tom Ogilvy "DRK" wrote in message ... Calculation is set to automatic. These are rather large workbooks and it does take a few seconds to see the changes. Maybe I should tell to wait a few seconds before printing? -- DRK "Tom Ogilvy" wrote: Is calculation set to automatic? (tools=Options=Calculation tab) Are both workbooks open when you make the change? Volatile only affects the function which contains the volatile statement - that function is recalculated anytime there is a calculation performed. It doesn't affect other cells, but any cell dependent on that cell (with the volatile function) should get updated if calculation is set to automatic. -- Regards, Tom Ogilvy "DRK" wrote in message ... I have a two workbooks which are linked together. One field in the master workbook has a TRUE/FALSE field. Through a link to a similar field on the slave workbook, it controls which set of values are being used. The values are either Financed or NonFinanced. When I run a macro to print either set of values, the macro sets the value in the master to either TRUE or FALSE. Then it prints. The print always seems to be one behind - that even though the valuie was set to TRUE by the macro, the calculated values are for the FALSE setting. And vice-versa if the macro sets it to false - it prints the TRUE version. If you run it the second time - without resetting the TRUE/FALSE, it's fine. I've tried applying Application.Volatile TRUE but it doesn't seeem to be helping. What else can I do to get the workbooks in synch? -- DRK |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I could not get the links to work. I ended up using Wait for 10 seconds.
Thanks for your help -- DRK "Gary Keramidas" wrote: maybe add this code between the subs to the beginning of the print macro Sub Update_Links() ActiveSheet.Unprotect ActiveWorkbook.UpdateLink Name:="Your_workbook_name.xls", _ Type:=xlExcelLinks ActiveSheet.Protect DrawingObjects:=True, contents:=True, Scenarios:=True End Sub -- Gary "DRK" wrote in message ... I have a two workbooks which are linked together. One field in the master workbook has a TRUE/FALSE field. Through a link to a similar field on the slave workbook, it controls which set of values are being used. The values are either Financed or NonFinanced. When I run a macro to print either set of values, the macro sets the value in the master to either TRUE or FALSE. Then it prints. The print always seems to be one behind - that even though the valuie was set to TRUE by the macro, the calculated values are for the FALSE setting. And vice-versa if the macro sets it to false - it prints the TRUE version. If you run it the second time - without resetting the TRUE/FALSE, it's fine. I've tried applying Application.Volatile TRUE but it doesn't seeem to be helping. What else can I do to get the workbooks in synch? -- DRK |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Forcing to recalculate | Excel Worksheet Functions | |||
Forcing to Uppercase | Excel Discussion (Misc queries) | |||
forcing UDF to run | Excel Worksheet Functions | |||
Forcing an input in a pop up box | Excel Programming | |||
Forcing users | Excel Programming |