ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Recalculation Done event? (https://www.excelbanter.com/excel-programming/346129-recalculation-done-event.html)

Lavneet Singh[_2_]

Recalculation Done event?
 

My application reads data from Excel workbook and, therefore, is hooked
to Excel (2003). Is there any API available to find if the
recalculation for the workbook (that my app uses) is over? Bascially, I
want to read data only once after recalculation in the workbook
finishes.


--
Lavneet Singh
------------------------------------------------------------------------
Lavneet Singh's Profile: http://www.excelforum.com/member.php...o&userid=28942
View this thread: http://www.excelforum.com/showthread...hreadid=486771


Ian

Recalculation Done event?
 
One way is to have a cell which changes value depending on the calculation
state.

eg
Range("A1").Value = 0
Worksheets("Sheet1").Calculate
Range("A1").Value = 1

Test the value of A1 before reading the data.

--
Ian
--
"Lavneet Singh"
wrote in message
news:Lavneet.Singh.1yua1z_1132563602.3591@excelfor um-nospam.com...

My application reads data from Excel workbook and, therefore, is hooked
to Excel (2003). Is there any API available to find if the
recalculation for the workbook (that my app uses) is over? Bascially, I
want to read data only once after recalculation in the workbook
finishes.


--
Lavneet Singh
------------------------------------------------------------------------
Lavneet Singh's Profile:
http://www.excelforum.com/member.php...o&userid=28942
View this thread: http://www.excelforum.com/showthread...hreadid=486771




Leith Ross[_294_]

Recalculation Done event?
 

Hello Lavneet Singh,

I am assuming since you are looking for APIs and say you are hooked
into Excel 2003 that your application is hooked into the messaging
system. The best approach I can think of would be to run Spyxx.exe to
see the messages being sent during recalculation. If you are using
Microsoft's SDK for C++ you have it already. If you are using some
other platform, there may be an equivalent program for the
application's language.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=486771


Lavneet Singh[_3_]

Recalculation Done event?
 

Hi,

Thanks Leith Ross and Ian for your replies.

Ian: The recalculation could be triggered externally (by user, fo
example) too. In such a case, is there a way to find if recalculatio
is done?

Leith Ross: The application in question uses COM via .net interop (C#
that basically uses Excel APIs directly. We aren't listening to windo
message loop. Sorry for using a potentially misleading wor
('hooked').

Thanks,
Lavneet

--
Lavneet Sing
-----------------------------------------------------------------------
Lavneet Singh's Profile: http://www.excelforum.com/member.php...fo&userid=2894
View this thread: http://www.excelforum.com/showthread.php?threadid=48677


Ian

Recalculation Done event?
 
Could you set a value such that, when the sheet is calculated, another cell
changes to a known value? eg set A2 as =A1 then change A1. Then test A2
before data transfer.

--
Ian
--
"Lavneet Singh"
wrote in message
news:Lavneet.Singh.1yukxn_1132577702.7295@excelfor um-nospam.com...

Hi,

Thanks Leith Ross and Ian for your replies.

Ian: The recalculation could be triggered externally (by user, for
example) too. In such a case, is there a way to find if recalculation
is done?

Leith Ross: The application in question uses COM via .net interop (C#)
that basically uses Excel APIs directly. We aren't listening to window
message loop. Sorry for using a potentially misleading word
('hooked').

Thanks,
Lavneet.


--
Lavneet Singh
------------------------------------------------------------------------
Lavneet Singh's Profile:
http://www.excelforum.com/member.php...o&userid=28942
View this thread: http://www.excelforum.com/showthread...hreadid=486771




Vic Eldridge[_3_]

Recalculation Done event?
 
Hi Lavneet,

Perhaps you could go by what's written in Excel's status bar.

If Left(Application.Statusbar,18) = "Calculating Cells:" then
'still calculating
End If

Although I'm not sure if you'll be able to access the property while the
workbook is busy calculating.



Regards,
Vic Eldridge




"Lavneet Singh" wrote:


Hi,

Thanks Leith Ross and Ian for your replies.

Ian: The recalculation could be triggered externally (by user, for
example) too. In such a case, is there a way to find if recalculation
is done?

Leith Ross: The application in question uses COM via .net interop (C#)
that basically uses Excel APIs directly. We aren't listening to window
message loop. Sorry for using a potentially misleading word
('hooked').

Thanks,
Lavneet.


--
Lavneet Singh
------------------------------------------------------------------------
Lavneet Singh's Profile: http://www.excelforum.com/member.php...o&userid=28942
View this thread: http://www.excelforum.com/showthread...hreadid=486771




All times are GMT +1. The time now is 09:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com