Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 13th, 2005, 05:41 PM
Registered User
 
Join Date: Aug 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Trapping Application Events ERROR

I followed the example in VBA2000, Chapter 13, pages 227-228 for enabling Application Event trapping from an Add-in. The first part seems to work, but creating the instance of my class module and assigning the Application object fails with this error message:

"User-defined type not defined" in the line
Public xlApplication As New clsAppEvents

I am using Excel 2002 on XP SP2.

I found a very similar example in VBA Help and it fails with the same message. This code is in a regular module as instructed.

Any help would be greatly appreciated.

Thanks,

Terry
 
Old August 14th, 2005, 01:23 PM
Registered User
 
Join Date: Aug 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Answering my own question...

I found the correct code to do this here:
http://www.cpearson.com/excel/AppEvent.htm

Both VBA Help and VBA2000 have incorrect code examples.

This let's you get events from all open workbooks which is good for an .xla.






Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP Error Trapping and Reporting kevorkian Classic ASP Basics 3 June 2nd, 2007 02:08 PM
error trapping majones@omaha Classic ASP Basics 0 January 5th, 2006 02:02 PM
Need some error trapping... cpk Classic ASP Databases 4 January 26th, 2005 08:10 AM
Error Trapping Steps jweyl SQL Server DTS 1 July 26th, 2004 05:59 PM
Trapping all events rajustha Pro VB.NET 2002/2003 1 December 10th, 2003 12:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.