ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   .XLA versus XLS sheet code (https://www.excelbanter.com/excel-programming/355592-xla-versus-xls-sheet-code.html)

ndalal

.XLA versus XLS sheet code
 
Hi,

I have an XLA add in which has menu item to insert new sheet. This
sheet gets inserted to the XLS project. The code behind inserting this
sheet resides in XLA, however I want to perform "worksheet_change" kind
of function for this new sheet. I already have the code for
"worksheet_change" in XLA, but that does not help because the new sheet
is part of XLS.

In order to do add "worksheet_change" for the new sheet manipulation,
how do I "automatically" add the code into the new sheet from XLA ??

I was thinking of inserting/copying the "worksheet_change" code from
XLA to this newly generated sheet in XLS. But how? Any ideas, clues?

Any help is appreciated.
Thanks in advance.

- Andy


Chip Pearson

.XLA versus XLS sheet code
 
The easiest way would be to use application level events in the
XLA. See http://www.cpearson.com/excel/AppEvent.htm for more
info.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"ndalal" wrote in message
oups.com...
Hi,

I have an XLA add in which has menu item to insert new sheet.
This
sheet gets inserted to the XLS project. The code behind
inserting this
sheet resides in XLA, however I want to perform
"worksheet_change" kind
of function for this new sheet. I already have the code for
"worksheet_change" in XLA, but that does not help because the
new sheet
is part of XLS.

In order to do add "worksheet_change" for the new sheet
manipulation,
how do I "automatically" add the code into the new sheet from
XLA ??

I was thinking of inserting/copying the "worksheet_change" code
from
XLA to this newly generated sheet in XLS. But how? Any ideas,
clues?

Any help is appreciated.
Thanks in advance.

- Andy




ndalal

.XLA versus XLS sheet code
 
I am not sure if I made my question clear..so here it goes......

XLA - add-in to insert sheet (name: foo) - this generates new sheet and
adds it to the XLS file (VBA project). This XLS file is not fixed.
Anybody can open their own XLS file and addin XLA to it.

XLS - sheet "foo" is inside this workbook. Now I would like to add code
for "worksheet_change" behind this sheet. Since this XLS (VBA project)
is not under my control, I cannot edit this XLS.

So I am trying to insert the code dynamically from XLA to the sheet in
XLS during the function call to insert sheet (XLA) by any user. And
thats where I am stucked.

Thanks for the help.



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

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