Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default Call an ADDIN function from VBA code

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Call an ADDIN function from VBA code

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default Call an ADDIN function from VBA code

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default Call an ADDIN function from VBA code

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Call an ADDIN function from VBA code

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 122
Default Call an ADDIN function from VBA code

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Call an ADDIN function from VBA code

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i call sub or function in vba code xxx Excel Discussion (Misc queries) 3 June 28th 06 11:47 AM
Addins - Calling an addin function from within VBA code Guy Normandeau Excel Programming 1 June 20th 06 07:22 PM
Disable call for Addin Marc[_16_] Excel Programming 2 December 12th 03 10:11 PM
using a function in an addin in my vba code archangel Excel Programming 2 September 6th 03 08:09 AM
COM addin call missing ken Excel Programming 0 July 22nd 03 03:39 PM


All times are GMT +1. The time now is 09:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"