Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to get excel to calculate from ASP?

hello everyone,

I can put and read values from excel using ado. I think the main
point of using excel is you can use it do some calculations. however,
when i put values in some cells and read the values of cells that
normally calculate something using those inputs, it doesnt work. I
have to open excel manually, then close it, before the values of those
cells update. How do I get excel to calculate from ASP using ADO or
some other method so that I can read the updated values?

Thanks for any help,

Mike

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 417
Default how to get excel to calculate from ASP?

After you put the values into the worksheet, use the following code:

Application.Calculate

.... to cause the recalculation engine to update all formulas before you
fetch the results. Normally, Excel waits until all macros have ended before
calling the recalculation engine.

Also, are you sure that your values are numbers, and not text values? You
can try the following routine to check. Simply select the range of cells
that are supposed to be numbers. It will stop and show each cell that is
not a number.

'----------------------------------------------------------------------
Public Sub CheckCells()
Dim rngCell As Range
Dim blnNonNumericFound As Boolean

For Each rngCell In Selection
If Not IsEmpty(rngCell) _
Then
If Not IsNumeric(rngCell) _
Then
blnNonNumericFound = True
With rngCell
.Activate
MsgBox "Cell " & .Address & " value is not a number!", _
vbInformation + vbOKOnly, _
"Check Cells"
End With
End If
End If
Next rngCell

If Not blnNonNumericFound _
Then
MsgBox "All cells in the selection were numbers.", _
vbInformation + vbOKOnly, _
"Check Cells"
End If
End Sub

--
Regards,
Bill Renaud



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 417
Default how to get excel to calculate from ASP?

<<Normally, Excel waits until all macros have ended before calling the
recalculation engine.

Experiment results: No longer true, in Excel 2000. Setting
Application.Calculation = xlCalculationManual stops calculation, but it
automatically resumes as soon as Application.Calculation =
xlCalculationAutomatic is executed.

Excel Recalculation articles:

"Excel Recalculation"
http://msdn2.microsoft.com/en-us/library/bb687891.aspx

"Recalculation in Microsoft Excel 2002"
http://msdn2.microsoft.com/en-us/lib...ffice.10).aspx
--
Regards,
Bill Renaud



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 to calculate e^2 in excel sif Excel Discussion (Misc queries) 3 April 4th 23 02:09 PM
How can I calculate Ker and Kei using Excel Binder Excel Worksheet Functions 2 March 2nd 09 06:49 AM
Activesheet.Calculate failing to calculate Daniel Bonallack Excel Programming 2 October 11th 06 03:16 AM
Range.calculate debug, Excel 2000 VBA compatability with Excel XP Bill Excel Programming 0 August 23rd 04 12:09 PM
Macro that hide or unhide and not calculate or calculate Jonsson Excel Programming 1 August 19th 03 04:22 PM


All times are GMT +1. The time now is 01:51 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"