Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Maybe this is not possible?
I have been trying to figure out how to fire a function when a workbook
is opened. I have been directed to workbook open event, I have found many examples that will work except they are limited to working only when a particular workbook is open. For example I have the APPEVENT.xls file (I believe via Chip Pearson's site) which essentially does what I need, except that it only works if APPEVENT is open. If APPEVENT is closed and I open another workbook, the code does not fire. Seems to me this is because there is code specifically in the ThisWorkBook module to make it all happen. I cannot (by the nature of the issue at hand) put this code in every workbook (we get a workbook, makes updates, these updates are then uploaded into access, and then re-exported from access the make a new updated workbook.) So if I understand this all correctly, I need to put the code that is normally put in the ThisWorkBook module, into a module on my addin. Except that everytime I do that, nothing will happen at all. So how can this be made into a truely application level process, that does not rely on ThisWorkBook to function? Or am I wrong in my assumptions. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Maybe this is not possible?
Putting it in your addin should work. What does the set-up code look like?
-- HTH Bob Phillips (replace xxxx in the email address with gmail if mailing direct) wrote in message oups.com... I have been trying to figure out how to fire a function when a workbook is opened. I have been directed to workbook open event, I have found many examples that will work except they are limited to working only when a particular workbook is open. For example I have the APPEVENT.xls file (I believe via Chip Pearson's site) which essentially does what I need, except that it only works if APPEVENT is open. If APPEVENT is closed and I open another workbook, the code does not fire. Seems to me this is because there is code specifically in the ThisWorkBook module to make it all happen. I cannot (by the nature of the issue at hand) put this code in every workbook (we get a workbook, makes updates, these updates are then uploaded into access, and then re-exported from access the make a new updated workbook.) So if I understand this all correctly, I need to put the code that is normally put in the ThisWorkBook module, into a module on my addin. Except that everytime I do that, nothing will happen at all. So how can this be made into a truely application level process, that does not rely on ThisWorkBook to function? Or am I wrong in my assumptions. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Maybe this is not possible?
Your wrong in your assumptions.
Put the same code that is in APPEVENT.xls in your addin including any code that is in the thisworkbook module of APPEVENT.xls. this will instantiate application level events as long as your addin is loaded and you don't hit the reset button in the VBE. -- Regards, Tom Ogilvy " wrote: I have been trying to figure out how to fire a function when a workbook is opened. I have been directed to workbook open event, I have found many examples that will work except they are limited to working only when a particular workbook is open. For example I have the APPEVENT.xls file (I believe via Chip Pearson's site) which essentially does what I need, except that it only works if APPEVENT is open. If APPEVENT is closed and I open another workbook, the code does not fire. Seems to me this is because there is code specifically in the ThisWorkBook module to make it all happen. I cannot (by the nature of the issue at hand) put this code in every workbook (we get a workbook, makes updates, these updates are then uploaded into access, and then re-exported from access the make a new updated workbook.) So if I understand this all correctly, I need to put the code that is normally put in the ThisWorkBook module, into a module on my addin. Except that everytime I do that, nothing will happen at all. So how can this be made into a truely application level process, that does not rely on ThisWorkBook to function? Or am I wrong in my assumptions. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Maybe this is not possible?
I am not surprised I am wrong in my assumptions. Hmmm let me work on
this some more, I must be missing probably some very small but obvious piece. Thanks to everyone for your help. Tom Ogilvy wrote: Your wrong in your assumptions. Put the same code that is in APPEVENT.xls in your addin including any code that is in the thisworkbook module of APPEVENT.xls. this will instantiate application level events as long as your addin is loaded and you don't hit the reset button in the VBE. -- Regards, Tom Ogilvy " wrote: I have been trying to figure out how to fire a function when a workbook is opened. I have been directed to workbook open event, I have found many examples that will work except they are limited to working only when a particular workbook is open. For example I have the APPEVENT.xls file (I believe via Chip Pearson's site) which essentially does what I need, except that it only works if APPEVENT is open. If APPEVENT is closed and I open another workbook, the code does not fire. Seems to me this is because there is code specifically in the ThisWorkBook module to make it all happen. I cannot (by the nature of the issue at hand) put this code in every workbook (we get a workbook, makes updates, these updates are then uploaded into access, and then re-exported from access the make a new updated workbook.) So if I understand this all correctly, I need to put the code that is normally put in the ThisWorkBook module, into a module on my addin. Except that everytime I do that, nothing will happen at all. So how can this be made into a truely application level process, that does not rely on ThisWorkBook to function? Or am I wrong in my assumptions. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|