Understand Workbook/Worksheet Events

  • Thread starter Thread starter Zamdrist
  • Start date Start date
Z

Zamdrist

I'm attempting to trigger some VBA code and tried both the Calculate &
Activate events of both the Workbook & Worksheet objects, however
neither seem to fire off.

I can get Activate to trigger by switching sheets, but that doesn't
work for me as I am relying on ActiveSheet.

My XLT has a database query tied to it also, but apparently that
doesn't trigger th Calculate event.

What would be the best way to automatically trigger my code after the
Workbook is open and after or while the underlying data is being
retrieved?

Thanks
 
Thank you Bob, that did work.

Now I just have to figure out how to not trigger that event when I open
the template itself. Need to trigger the event, some event only when I
open a workbook based on the template...like Word & auto_new or
Document New event...I'll look over the site you sent me though.
Thanks.

Steve
 
How about the Workbook open application event and check if the file opened
is that template?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Bob said:
How about the Workbook open application event and check if the file opened
is that template?

Yep...that's what I did :)

If ActiveWorkbook.Name = "SomeWorkbook.xlt" Then Exit Sub

Thanks!
 

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

Back
Top