Maybe this is not possible?

R

Robert.Cordani

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.
 
B

Bob Phillips

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)
 
T

Tom Ogilvy

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.
 
R

Robert.Cordani

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top