Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a function in an addin that is loaded. I seem unable to come up with
the syntax in VBA code to get it to function properly. As a workbook function it is used as =topleft(r) where r is a range If I copy the code into the module, it is used as rtl=topleft(r) How do I use it without cloning the code into the module? Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Marvin
Use Application.run "YourAddin.xla",Argument HTH Cordially Pascal "Marvin" a écrit dans le message de news: ... I have a function in an addin that is loaded. I seem unable to come up with the syntax in VBA code to get it to function properly. As a workbook function it is used as =topleft(r) where r is a range If I copy the code into the module, it is used as rtl=topleft(r) How do I use it without cloning the code into the module? Thanks. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This syntax allows execution, but does not allow for a return value from the
function in ther ADDIN. "papou" wrote: Hi Marvin Use Application.run "YourAddin.xla",Argument HTH Cordially Pascal "Marvin" a écrit dans le message de news: ... I have a function in an addin that is loaded. I seem unable to come up with the syntax in VBA code to get it to function properly. As a workbook function it is used as =topleft(r) where r is a range If I copy the code into the module, it is used as rtl=topleft(r) How do I use it without cloning the code into the module? Thanks. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Unfortunately, the syntax you suggest doesn't work. My code is:
rtl=application.run "Marvin's Private Functions.xla!topleft",r It produces a compiler error indicating Expected: end of statement "papou" wrote: Hi Marvin Yes you can return the value with : MyValue = Application.run "YourAddin.xla",Argument HTH Cordially Pascal "Marvin" a écrit dans le message de news: ... This syntax allows execution, but does not allow for a return value from the function in ther ADDIN. "papou" wrote: Hi Marvin Use Application.run "YourAddin.xla",Argument HTH Cordially Pascal "Marvin" a écrit dans le message de news: ... I have a function in an addin that is loaded. I seem unable to come up with the syntax in VBA code to get it to function properly. As a workbook function it is used as =topleft(r) where r is a range If I copy the code into the module, it is used as rtl=topleft(r) How do I use it without cloning the code into the module? Thanks. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
maybe
rtl=application.run("'Marvin's Private Functions.xla'!topleft", r) Notice the ()'s and the apostrophes. Marvin wrote: Unfortunately, the syntax you suggest doesn't work. My code is: rtl=application.run "Marvin's Private Functions.xla!topleft",r It produces a compiler error indicating Expected: end of statement "papou" wrote: Hi Marvin Yes you can return the value with : MyValue = Application.run "YourAddin.xla",Argument HTH Cordially Pascal "Marvin" a écrit dans le message de news: ... This syntax allows execution, but does not allow for a return value from the function in ther ADDIN. "papou" wrote: Hi Marvin Use Application.run "YourAddin.xla",Argument HTH Cordially Pascal "Marvin" a écrit dans le message de news: ... I have a function in an addin that is loaded. I seem unable to come up with the syntax in VBA code to get it to function properly. As a workbook function it is used as =topleft(r) where r is a range If I copy the code into the module, it is used as rtl=topleft(r) How do I use it without cloning the code into the module? Thanks. -- Dave Peterson |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In order to make the functions of the add-in available like normal VBA
functions, you need to use the menu option Tools References and add a reference to the add-in project to the VBE project. Then, you should be able to just do something like this in your VBA code: x = topleft(Range(r)) On Jun 22, 6:46 am, Marvin wrote: I have a function in an addin that is loaded. I seem unable to come up with the syntax in VBA code to get it to function properly. As a workbook function it is used as =topleft(r) where r is a range If I copy the code into the module, it is used as rtl=topleft(r) How do I use it without cloning the code into the module? Thanks. |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That certainly is an option. But you don't _need_ to do it that way.
Randy Harmelink wrote: In order to make the functions of the add-in available like normal VBA functions, you need to use the menu option Tools References and add a reference to the add-in project to the VBE project. Then, you should be able to just do something like this in your VBA code: x = topleft(Range(r)) On Jun 22, 6:46 am, Marvin wrote: I have a function in an addin that is loaded. I seem unable to come up with the syntax in VBA code to get it to function properly. As a workbook function it is used as =topleft(r) where r is a range If I copy the code into the module, it is used as rtl=topleft(r) How do I use it without cloning the code into the module? Thanks. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how can i call sub or function in vba code | Excel Discussion (Misc queries) | |||
Addins - Calling an addin function from within VBA code | Excel Programming | |||
Disable call for Addin | Excel Programming | |||
using a function in an addin in my vba code | Excel Programming | |||
COM addin call missing | Excel Programming |