Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DRK DRK is offline
external usenet poster
 
Posts: 40
Default Forcing recacalculation

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Forcing recacalculation

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default Forcing recacalculation

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   Report Post  
Posted to microsoft.public.excel.programming
DRK DRK is offline
external usenet poster
 
Posts: 40
Default Forcing recacalculation

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Forcing recacalculation

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   Report Post  
Posted to microsoft.public.excel.programming
DRK DRK is offline
external usenet poster
 
Posts: 40
Default Forcing recacalculation

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   Report Post  
Posted to microsoft.public.excel.programming
DRK DRK is offline
external usenet poster
 
Posts: 40
Default Forcing recacalculation

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
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
Forcing to recalculate Michael.Tarnowski Excel Worksheet Functions 7 February 11th 09 02:49 PM
Forcing to Uppercase Connie Martin Excel Discussion (Misc queries) 4 February 7th 08 08:37 PM
forcing UDF to run Stefi Excel Worksheet Functions 4 December 29th 05 03:46 PM
Forcing an input in a pop up box David Excel Programming 2 October 5th 04 11:31 PM
Forcing users M atthew J. Couture Excel Programming 1 April 4th 04 05:25 PM


All times are GMT +1. The time now is 01:11 AM.

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

About Us

"It's about Microsoft Excel"