Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add In Questions
Here are a couple of questions about using Add-Ins:
How can I attach an Add-In to a Workbook using VBA? Once the Add-In is attached, how do I associate the subroutines and functions in the add-in with events taking place in the workbook.worksheet where it is attached? For example an on_activate event in Sheet1 of the workbook that has an add-in attached needs to run code that exists in the add-in. Thanks, Keith |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add In Questions
An add-in is a workbook, albeit a special type of workbook. You don't attach
it to a workbook, it is available to the Excel application when installed, and thus to all workbooks. You can create worksheet events for all workbooks by creating application events in the add-in. Here is some example code. First add a class module, name it clsEventSink, and add this code Option Explicit Private WithEvents App As Application Private Sub App_SheetActivate(ByVal Sh As Object) 'your code here End Sub Private Sub Class_Initialize() Set App = Application End Sub Then in Thisworkbook, add this code Option Explicit Private cAppEvents As clsEventSink Private Sub Workbook_Open() Set cAppEvents = New clsEventSink End Sub 'This is workbook event code. 'To input this code, right click on the Excel icon on the worksheet '(or next to the File menu if you maximise your workbooks), 'select View Code from the menu, and paste the code -- HTH RP (remove nothere from the email address if mailing direct) "keithb" wrote in message ... Here are a couple of questions about using Add-Ins: How can I attach an Add-In to a Workbook using VBA? Once the Add-In is attached, how do I associate the subroutines and functions in the add-in with events taking place in the workbook.worksheet where it is attached? For example an on_activate event in Sheet1 of the workbook that has an add-in attached needs to run code that exists in the add-in. Thanks, Keith |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Answers to questions posing more questions in a workbook | Excel Worksheet Functions | |||
View Questions and Answer to questions I created | Excel Discussion (Misc queries) | |||
007 questions | Charts and Charting in Excel | |||
2 Questions | New Users to Excel | |||
A few questions please help! | New Users to Excel |