Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
okay, this should be pretty darned simple, but it seems those are always the things that jump up and bite me
i've created a workbook that has 12 modules and 7 user forms. this workbook will be distrubuted to others, so obvioulsy the best thing to do is to make all the code an add in and have some basic workbook and worksheet functions that call the add in code. i've gotten that far, and added code that successfully adds the add in at the opening of the workbook. but then it says that it can not see any of my add in module names. am i referencing them incorrectly? this has to be something that is very simple that i am just having a brain hiccup on.... i.e. Private Sub Worksheet_Change(ByVal Target As Range AddInWorksheet_Change Targe End Su where AddInWorksheet_Change is defined in the addin workbook as a public sub Public Sub AddInWorksheet_Change(ByVal Target As Range Dim sCellAddress As Strin Dim rNew As Rang Dim rOld As Rang etc..... thanks much heidi |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Heidi;
If I understand you question correctly you can change the subs to be public instead of private and that should work. Thanks, Greg -----Original Message----- okay, this should be pretty darned simple, but it seems those are always the things that jump up and bite me. i've created a workbook that has 12 modules and 7 user forms. this workbook will be distrubuted to others, so obvioulsy the best thing to do is to make all the code an add in and have some basic workbook and worksheet functions that call the add in code. i've gotten that far, and added code that successfully adds the add in at the opening of the workbook. but then it says that it can not see any of my add in module names. am i referencing them incorrectly? this has to be something that is very simple that i am just having a brain hiccup on..... i.e.: Private Sub Worksheet_Change(ByVal Target As Range) AddInWorksheet_Change Target End Sub where AddInWorksheet_Change is defined in the addin workbook as a public sub: Public Sub AddInWorksheet_Change(ByVal Target As Range) Dim sCellAddress As String Dim rNew As Range Dim rOld As Range etc...... thanks much, heidi . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you create a reference from the workbook to the addin, it should work.
Otherwise, you have to use Application.Run -- Regards, Tom Ogilvy "alfaista" wrote in message ... okay, this should be pretty darned simple, but it seems those are always the things that jump up and bite me. i've created a workbook that has 12 modules and 7 user forms. this workbook will be distrubuted to others, so obvioulsy the best thing to do is to make all the code an add in and have some basic workbook and worksheet functions that call the add in code. i've gotten that far, and added code that successfully adds the add in at the opening of the workbook. but then it says that it can not see any of my add in module names. am i referencing them incorrectly? this has to be something that is very simple that i am just having a brain hiccup on..... i.e.: Private Sub Worksheet_Change(ByVal Target As Range) AddInWorksheet_Change Target End Sub where AddInWorksheet_Change is defined in the addin workbook as a public sub: Public Sub AddInWorksheet_Change(ByVal Target As Range) Dim sCellAddress As String Dim rNew As Range Dim rOld As Range etc...... thanks much, heidi |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On additional caution. You can't directly show a userform from your
workbook. You would need to call a macro in the addin that shows the userform or that at least loads it and returns a reference to it. -- Regards, Tom Ogilvy "alfaista" wrote in message ... okay, this should be pretty darned simple, but it seems those are always the things that jump up and bite me. i've created a workbook that has 12 modules and 7 user forms. this workbook will be distrubuted to others, so obvioulsy the best thing to do is to make all the code an add in and have some basic workbook and worksheet functions that call the add in code. i've gotten that far, and added code that successfully adds the add in at the opening of the workbook. but then it says that it can not see any of my add in module names. am i referencing them incorrectly? this has to be something that is very simple that i am just having a brain hiccup on..... i.e.: Private Sub Worksheet_Change(ByVal Target As Range) AddInWorksheet_Change Target End Sub where AddInWorksheet_Change is defined in the addin workbook as a public sub: Public Sub AddInWorksheet_Change(ByVal Target As Range) Dim sCellAddress As String Dim rNew As Range Dim rOld As Range etc...... thanks much, heidi |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thanks much! i knew i had forgotten something simple. too much of staring at the trees in the forest, so to say
the reference fixed it all up, works like a charm thanks again ----- Tom Ogilvy wrote: ---- On additional caution. You can't directly show a userform from you workbook. You would need to call a macro in the addin that shows th userform or that at least loads it and returns a reference to it -- Regards Tom Ogilv "alfaista" wrote in messag .. okay, this should be pretty darned simple, but it seems those are alway the things that jump up and bite me i've created a workbook that has 12 modules and 7 user forms. thi workbook will be distrubuted to others, so obvioulsy the best thing to do i to make all the code an add in and have some basic workbook and workshee functions that call the add in code i've gotten that far, and added code that successfully adds the add in a the opening of the workbook. but then it says that it can not see any of m add in module names am i referencing them incorrectly? this has to be something that is ver simple that i am just having a brain hiccup on.... i.e. Private Sub Worksheet_Change(ByVal Target As Range AddInWorksheet_Change Targe End Su where AddInWorksheet_Change is defined in the addin workbook as a publi sub Public Sub AddInWorksheet_Change(ByVal Target As Range Dim sCellAddress As Strin Dim rNew As Rang Dim rOld As Rang etc..... thanks much heid |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Reference Addin Module from sheet code | Excel Programming | |||
Remove Excel AddIn from AddIn List !! Help | Excel Programming | |||
Accessing Addin from Sheet_Event Code | Excel Programming | |||
Accessing Addin from Sheet_Event Code | Excel Programming | |||
using a function in an addin in my vba code | Excel Programming |