Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 380
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 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
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



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