Understand Workbook/Worksheet Events

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
 
Z

Zamdrist

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
 
B

Bob Phillips

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

Zamdrist

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!
 
Top