ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SheetCalculate (F9) does not reach the excel-addin (https://www.excelbanter.com/excel-programming/353229-sheetcalculate-f9-does-not-reach-excel-addin.html)

kikde

SheetCalculate (F9) does not reach the excel-addin
 
Hi,
i have a problem with an addin.
the sheetCalculate-event won't be fired for the add-In, so the code in the
event handler of the add-inn won't be started...

few more infos:
- Other events like WorkbookActivate will be fired for the add-in
- sheetCalculate will be fired for the active workbook (only for testing,
there is no code
- no other add-inns are started


Bob Phillips[_6_]

SheetCalculate (F9) does not reach the excel-addin
 
Sheet calculate would not fire for the add-in as that is not the active
sheet.

Why are you having calculations in the add-in, not on the target worksheet?
Perhaps you could re-design to remove it from the add-in.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"kikde" wrote in message
...
Hi,
i have a problem with an addin.
the sheetCalculate-event won't be fired for the add-In, so the code in the
event handler of the add-inn won't be started...

few more infos:
- Other events like WorkbookActivate will be fired for the add-in
- sheetCalculate will be fired for the active workbook (only for testing,
there is no code
- no other add-inns are started




Antonio Elinon[_2_]

SheetCalculate (F9) does not reach the excel-addin
 
You can try to fire the sheetCalculate event via another event.
There are two main reasons why you would want to re-calculate in your add-in:
1. At the beginning of your process - therefore you could fire a manual
calculate inside the WorkbookActivate event.
2. During processing - this means you have changed a cell value in the addin
sheet and wish to recalculate based on the new cell value. Since an addin is
usually hidden, this should mean that you know which cell changed. Therefore
you can use the Workbook_SheetChange event to include a manual recalculation
code.

Kind Regards,
Antonio Elinon

"kikde" wrote:

Hi,
i have a problem with an addin.
the sheetCalculate-event won't be fired for the add-In, so the code in the
event handler of the add-inn won't be started...

few more infos:
- Other events like WorkbookActivate will be fired for the add-in
- sheetCalculate will be fired for the active workbook (only for testing,
there is no code
- no other add-inns are started


Charles Williams

SheetCalculate (F9) does not reach the excel-addin
 
When you press F9 Excel does a Recalculate of all open workbooks, not a
Sheet calculate: did you mean Shift-F9 (recalculates all selected sheets)?
If so then Shift-F9 will not trigger a recalc of sheets in an addin because
the sheets will not be selected.

Why do you think that pressing F9 will not trigger a recalc of sheets in an
addin? It does trigger a recalc of addin sheets in my system: try adding a
volatile function to a sheet in your addin and putting some code
(debug.print "Hello") in the worksheet_calculate sub of that sheet. You will
see "Hello" in the immediate pane every time you press F9.

regards
Charles
______________________
Decision Models
FastExcel 2.1 now available
www.DecisionModels.com


"kikde" wrote in message
...
Hi,
i have a problem with an addin.
the sheetCalculate-event won't be fired for the add-In, so the code in the
event handler of the add-inn won't be started...

few more infos:
- Other events like WorkbookActivate will be fired for the add-in
- sheetCalculate will be fired for the active workbook (only for testing,
there is no code
- no other add-inns are started




kikde

SheetCalculate (F9) does not reach the excel-addin
 
the problem is: if have code in the sheetcalculate event of the addIn!
if i have a active workbook and press F9, this event handler should be
raised. but it won't, only the sheetcalculate of the active workbook will be
called.

"kikde" wrote:

Hi,
i have a problem with an addin.
the sheetCalculate-event won't be fired for the add-In, so the code in the
event handler of the add-inn won't be started...

few more infos:
- Other events like WorkbookActivate will be fired for the add-in
- sheetCalculate will be fired for the active workbook (only for testing,
there is no code
- no other add-inns are started


Antonio Elinon[_2_]

SheetCalculate (F9) does not reach the excel-addin
 
If the code in the sheetcalculate of the active workbook is yours, then
revise this to add a direct call to the sheetcalculate of the addin.

If it is not yours to revise, then it is not possible as the add-in has no
way of knowing about the active workbook recalculation. The only way it can
know, is if the addin can insert code on-the-fly into the active workbook
(and every workbook that becomes active.)

A simple suggestion is to program an Alt-key combination that will
recalculate the active workbook and recalculate the addin.

Regards,
Antonio Elinon


"kikde" wrote:

the problem is: if have code in the sheetcalculate event of the addIn!
if i have a active workbook and press F9, this event handler should be
raised. but it won't, only the sheetcalculate of the active workbook will be
called.

"kikde" wrote:

Hi,
i have a problem with an addin.
the sheetCalculate-event won't be fired for the add-In, so the code in the
event handler of the add-inn won't be started...

few more infos:
- Other events like WorkbookActivate will be fired for the add-in
- sheetCalculate will be fired for the active workbook (only for testing,
there is no code
- no other add-inns are started


Charles Williams

SheetCalculate (F9) does not reach the excel-addin
 
Worksheet.Calculate only gets called after a sheet is recalculated: Add a
volatile function ( for example =Time()) to the worksheet in your addin to
make it recalculate at each application recalculation..

or use application level events to trap the calculate event. This is more
complex: see Chip Pearson's site
http://www.cpearson.com/excel/AppEvent.htm


HTH
Charles
______________________
Decision Models
FastExcel 2.1 now available
www.DecisionModels.com

"kikde" wrote in message
...
the problem is: if have code in the sheetcalculate event of the addIn!
if i have a active workbook and press F9, this event handler should be
raised. but it won't, only the sheetcalculate of the active workbook will
be
called.

"kikde" wrote:

Hi,
i have a problem with an addin.
the sheetCalculate-event won't be fired for the add-In, so the code in
the
event handler of the add-inn won't be started...

few more infos:
- Other events like WorkbookActivate will be fired for the add-in
- sheetCalculate will be fired for the active workbook (only for testing,
there is no code
- no other add-inns are started





All times are GMT +1. The time now is 08:53 PM.

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