Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Zoo Zoo is offline
external usenet poster
 
Posts: 40
Default How do I turn around 'Circulation Reference' msgbox?

I have a UDF named Test() written below.
And I put it into Sheet1.A1 : = Test()
And I activate Sheet2 and press Ctrl + Alt + F9 (CalculateFull).
Then a msgbox is shown : 'There is a circulation reference....'
I want to turn around the msgbox.
(I tried setting Apllication.DisplayAlerts property to false in vain.)

'---------UDF -------------------------------
Function TEST()
If Not Application.Caller.Parent Is ActiveSheet Then
TEST = Application.Caller.Value
Exit Function
End If
TEST = Format(Now, "HH:MM:SS")
End Function

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default How do I turn around 'Circulation Reference' msgbox?

Zoo,
Apart from the fact that your function no return value (As String), check
the value in the Immediate window:

?typename(Application.Caller), Application.Caller
Double 468385800

The Help does not mention a return value of Double, so I would assume it
some error code
I guess your were expecting it to evaluate to the range "A1".

I do not use these properties so I can't advise you other than the above.

NickHK


"Zoo" wrote in message
...
I have a UDF named Test() written below.
And I put it into Sheet1.A1 : = Test()
And I activate Sheet2 and press Ctrl + Alt + F9 (CalculateFull).
Then a msgbox is shown : 'There is a circulation reference....'
I want to turn around the msgbox.
(I tried setting Apllication.DisplayAlerts property to false in vain.)

'---------UDF -------------------------------
Function TEST()
If Not Application.Caller.Parent Is ActiveSheet Then
TEST = Application.Caller.Value
Exit Function
End If
TEST = Format(Now, "HH:MM:SS")
End Function



  #3   Report Post  
Posted to microsoft.public.excel.programming
Zoo Zoo is offline
external usenet poster
 
Posts: 40
Default How do I turn around 'Circulation Reference' msgbox?

Thank you for your reply , NichHK.

Application.Caller Is set to Sheet1.Range("A1") in this case.
When I type the formula '=TEST()' , Application.Caller.Parent is Sheet1.
Since Sheet1 is activated by me to enter the formula,
Application.Caller.Parent(Sheet1) is ActiveSheet, and TEST returns
Format(Now, "HH:MM:SS").

When I activate Sheet2, TEST returns the already calculated value (A1's
value itself).

The purpose of this macro is to try to make UDF being recalculated only when
the sheet is activated.

"NickHK" wrote in message
...
Zoo,
Apart from the fact that your function no return value (As String), check
the value in the Immediate window:

?typename(Application.Caller), Application.Caller
Double 468385800

The Help does not mention a return value of Double, so I would assume it
some error code
I guess your were expecting it to evaluate to the range "A1".

I do not use these properties so I can't advise you other than the above.

NickHK


"Zoo" wrote in message
...
I have a UDF named Test() written below.
And I put it into Sheet1.A1 : = Test()
And I activate Sheet2 and press Ctrl + Alt + F9 (CalculateFull).
Then a msgbox is shown : 'There is a circulation reference....'
I want to turn around the msgbox.
(I tried setting Apllication.DisplayAlerts property to false in vain.)

'---------UDF -------------------------------
Function TEST()
If Not Application.Caller.Parent Is ActiveSheet Then
TEST = Application.Caller.Value
Exit Function
End If
TEST = Format(Now, "HH:MM:SS")
End Function




  #4   Report Post  
Posted to microsoft.public.excel.programming
Zoo Zoo is offline
external usenet poster
 
Posts: 40
Default How do I turn around 'Circulation Reference' msgbox?

I see what you want to say clearly now.
I changed my code as below.
As you've said Application.Caller.Value has no value in the msgbox.

I thougt the problem is just a message 'Circulation....'.
But it is wrong , the proble is Application.Caller.Value does not work fine
in this case.
I should think the whole idea again.

Thank you.

Function TEST()
If Not Application.Caller.Parent Is ActiveSheet Then
MsgBox Application.Caller.Value

TEST = Application.Caller.Value
Exit Function
End If
TEST = Format(Now, "HH:MM:SS")
End Function

"NickHK" wrote in message
...
Zoo,
Yes, I understand all that, but have you actually tested the value of
Application.Caller when Sheet2 is the active sheet ?

NickHK


"Zoo" wrote in message
...
Thank you for your reply , NichHK.

Application.Caller Is set to Sheet1.Range("A1") in this case.
When I type the formula '=TEST()' , Application.Caller.Parent is Sheet1.
Since Sheet1 is activated by me to enter the formula,
Application.Caller.Parent(Sheet1) is ActiveSheet, and TEST returns
Format(Now, "HH:MM:SS").

When I activate Sheet2, TEST returns the already calculated value (A1's
value itself).

The purpose of this macro is to try to make UDF being recalculated only

when
the sheet is activated.

"NickHK" wrote in message
...
Zoo,
Apart from the fact that your function no return value (As String),

check
the value in the Immediate window:

?typename(Application.Caller), Application.Caller
Double 468385800

The Help does not mention a return value of Double, so I would assume

it
some error code
I guess your were expecting it to evaluate to the range "A1".

I do not use these properties so I can't advise you other than the

above.

NickHK


"Zoo" wrote in message
...
I have a UDF named Test() written below.
And I put it into Sheet1.A1 : = Test()
And I activate Sheet2 and press Ctrl + Alt + F9 (CalculateFull).
Then a msgbox is shown : 'There is a circulation reference....'
I want to turn around the msgbox.
(I tried setting Apllication.DisplayAlerts property to false in

vain.)

'---------UDF -------------------------------
Function TEST()
If Not Application.Caller.Parent Is ActiveSheet Then
TEST = Application.Caller.Value
Exit Function
End If
TEST = Format(Now, "HH:MM:SS")
End Function







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default How do I turn around 'Circulation Reference' msgbox?

Zoo,
Yes, I understand all that, but have you actually tested the value of
Application.Caller when Sheet2 is the active sheet ?

NickHK


"Zoo" wrote in message
...
Thank you for your reply , NichHK.

Application.Caller Is set to Sheet1.Range("A1") in this case.
When I type the formula '=TEST()' , Application.Caller.Parent is Sheet1.
Since Sheet1 is activated by me to enter the formula,
Application.Caller.Parent(Sheet1) is ActiveSheet, and TEST returns
Format(Now, "HH:MM:SS").

When I activate Sheet2, TEST returns the already calculated value (A1's
value itself).

The purpose of this macro is to try to make UDF being recalculated only

when
the sheet is activated.

"NickHK" wrote in message
...
Zoo,
Apart from the fact that your function no return value (As String),

check
the value in the Immediate window:

?typename(Application.Caller), Application.Caller
Double 468385800

The Help does not mention a return value of Double, so I would assume it
some error code
I guess your were expecting it to evaluate to the range "A1".

I do not use these properties so I can't advise you other than the

above.

NickHK


"Zoo" wrote in message
...
I have a UDF named Test() written below.
And I put it into Sheet1.A1 : = Test()
And I activate Sheet2 and press Ctrl + Alt + F9 (CalculateFull).
Then a msgbox is shown : 'There is a circulation reference....'
I want to turn around the msgbox.
(I tried setting Apllication.DisplayAlerts property to false in vain.)

'---------UDF -------------------------------
Function TEST()
If Not Application.Caller.Parent Is ActiveSheet Then
TEST = Application.Caller.Value
Exit Function
End If
TEST = Format(Now, "HH:MM:SS")
End Function








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default How do I turn around 'Circulation Reference' msgbox?

Zoo,
After looking at this again, I assume it is because whilst
Application.Caller.Parent evaluates to a valid object,
Application.Caller.Value is indeterminate at the time you Get the value.
As I do not work with circular references or .Caller, I can't help much,
although these links may show you a way to change to calculation method to
something suitable:

http://www.decisionmodels.com/calcsecretsh.htm

http://www.cpearson.com/excel/sheetref.htm

NickHK

"Zoo" wrote in message
...
I see what you want to say clearly now.
I changed my code as below.
As you've said Application.Caller.Value has no value in the msgbox.

I thougt the problem is just a message 'Circulation....'.
But it is wrong , the proble is Application.Caller.Value does not work

fine
in this case.
I should think the whole idea again.

Thank you.

Function TEST()
If Not Application.Caller.Parent Is ActiveSheet Then
MsgBox Application.Caller.Value

TEST = Application.Caller.Value
Exit Function
End If
TEST = Format(Now, "HH:MM:SS")
End Function

"NickHK" wrote in message
...
Zoo,
Yes, I understand all that, but have you actually tested the value of
Application.Caller when Sheet2 is the active sheet ?

NickHK


"Zoo" wrote in message
...
Thank you for your reply , NichHK.

Application.Caller Is set to Sheet1.Range("A1") in this case.
When I type the formula '=TEST()' , Application.Caller.Parent is

Sheet1.
Since Sheet1 is activated by me to enter the formula,
Application.Caller.Parent(Sheet1) is ActiveSheet, and TEST returns
Format(Now, "HH:MM:SS").

When I activate Sheet2, TEST returns the already calculated value

(A1's
value itself).

The purpose of this macro is to try to make UDF being recalculated

only
when
the sheet is activated.

"NickHK" wrote in message
...
Zoo,
Apart from the fact that your function no return value (As String),

check
the value in the Immediate window:

?typename(Application.Caller), Application.Caller
Double 468385800

The Help does not mention a return value of Double, so I would

assume
it
some error code
I guess your were expecting it to evaluate to the range "A1".

I do not use these properties so I can't advise you other than the

above.

NickHK


"Zoo" wrote in message
...
I have a UDF named Test() written below.
And I put it into Sheet1.A1 : = Test()
And I activate Sheet2 and press Ctrl + Alt + F9 (CalculateFull).
Then a msgbox is shown : 'There is a circulation reference....'
I want to turn around the msgbox.
(I tried setting Apllication.DisplayAlerts property to false in

vain.)

'---------UDF -------------------------------
Function TEST()
If Not Application.Caller.Parent Is ActiveSheet Then
TEST = Application.Caller.Value
Exit Function
End If
TEST = Format(Now, "HH:MM:SS")
End Function









  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How do I turn around 'Circulation Reference' msgbox?

Maybe you can use .text:

Option Explicit
Function TEST()
Application.Volatile
If Not Application.Caller.Parent.Name = ActiveSheet.Name Then
TEST = Application.Caller.Text
Exit Function
End If
TEST = Format(Now, "HH:MM:SS")
End Function




Zoo wrote:

I have a UDF named Test() written below.
And I put it into Sheet1.A1 : = Test()
And I activate Sheet2 and press Ctrl + Alt + F9 (CalculateFull).
Then a msgbox is shown : 'There is a circulation reference....'
I want to turn around the msgbox.
(I tried setting Apllication.DisplayAlerts property to false in vain.)

'---------UDF -------------------------------
Function TEST()
If Not Application.Caller.Parent Is ActiveSheet Then
TEST = Application.Caller.Value
Exit Function
End If
TEST = Format(Now, "HH:MM:SS")
End Function


--

Dave Peterson
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
How do I turn off R1C1 reference type in Excel 2007? Mag Excel Worksheet Functions 3 March 16th 10 04:18 PM
How do I turn off page reference in page break preview Nic_Qld Excel Discussion (Misc queries) 2 June 3rd 09 07:17 PM
library circulation function line New Users to Excel 3 July 14th 08 09:09 PM
How turn on excel functn, dbleclick on cell 2 show reference? Dave Setting up and Configuration of Excel 1 November 24th 05 12:04 AM
Code to automatically turn on and turn off Track Changes John[_46_] Excel Programming 1 October 7th 03 02:22 AM


All times are GMT +1. The time now is 12:19 PM.

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

About Us

"It's about Microsoft Excel"