Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA -isn't working in Excell 2007, working in Excell 2003

Status
Not open for further replies.

Evening

Technical User
Jan 19, 2005
45
0
0
CA
I used a special VBA defined calculations in Excell under 2003 version, and it was working without problem. When I run this under 2007, isn't working. Why?

The calculations looks like this:

Function AngleSol(B As Double) As Double
' Find the value F such that F - Tan(F) = B

Dim Epsilon As Double
Dim Counter As Double
Dim F As Double

F = 0.1
Epsilon = Tan(F) - F - B
While (Abs(Epsilon) > 0.00000000001) And Counter < 100000
F = F * (1 - Epsilon)
Epsilon = Tan(F) - F - B
Counter = Counter + 1
Wend
AngleSol = F
End Function
 
I forgot to tell that if i open a create a new workbook in Excell 2007 and place the calcuations, it's working.
If I open the workbook in Excell 2007 which was created in Excell 2003, isn't working.
What's the difference?
 



What does, "isn't working" mean?

1. Does not run at all?

2. Errors on a particular statement? If so, which one and what eror?

3. Does not return the desired result? If so, what argument, & what result.

BTW, I'd use Do...Loop rather than While...Wend.

Skip,
[sub]
[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue][/sub]
 
Skip

Thank you for reply..

Basically it couldn't calculate the value...It was an error in field ... I found later that the macro wasn't set properly in Excell 2007... I am new in Excell 2007, very difficult to find appropricate command, but 2 hours later finally i succeded to enable the macro... Now it's working .
Anyway, thank you for reply again..

 




Glad I couldn't help :)

Skip,
[sub]
[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top