Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Calling function from non-referenced add-in

Hello,

I've tried researching this topic but it is still not clear to me what
the correct syntax is, or if this is even possible.

Inside one sub, I would like to call a function in an add-in, but want
it to work if the add-in is not necessarily referenced in the project.

Ex.

str = fct_name( arg1, arg2)

This works if I reference the add-in.

str = (?)fct_name(arg1, arg2)

Isn't there a way to fully qualify this (?) such that the add-in does
not need to be specifically referenced?

Thanks for any input.
Eric
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Calling function from non-referenced add-in

s = Application.Run("myAddin.xla!fct_name", arg1, arg2)

Inclusion of the addin name may not be necessary if there's no ambiguity of
the procedure name in any open project.

Regards,
Peter T

wrote in message
...
Hello,

I've tried researching this topic but it is still not clear to me what
the correct syntax is, or if this is even possible.

Inside one sub, I would like to call a function in an add-in, but want
it to work if the add-in is not necessarily referenced in the project.

Ex.

str = fct_name( arg1, arg2)

This works if I reference the add-in.

str = (?)fct_name(arg1, arg2)

Isn't there a way to fully qualify this (?) such that the add-in does
not need to be specifically referenced?

Thanks for any input.
Eric



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Calling function from non-referenced add-in

On Feb 14, 5:48*pm, "Peter T" <peter_t@discussions wrote:
s = Application.Run("myAddin.xla!fct_name", arg1, arg2)

Inclusion of the addin name may not be necessary if there's no ambiguity of
the procedure name in any open project.

Regards,
Peter T

wrote in message

...



Hello,


I've tried researching this topic but it is still not clear to me what
the correct syntax is, or if this is even possible.


Inside one sub, I would like to call a function in an add-in, but want
it to work if the add-in is not necessarily referenced in the project.


Ex.


str = fct_name( arg1, arg2)


This works if I reference the add-in.


str = (?)fct_name(arg1, arg2)


Isn't there a way to fully qualify this (?) such that the add-in does
not need to be specifically referenced?


Thanks for any input.
Eric- Hide quoted text -


- Show quoted text -


Thanks. This worked for me. Just curiuos how the syntax would change
if there was ambiguity and I had to specify the module as well?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Calling function from non-referenced add-in

wrote in message
On Feb 14, 5:48 pm, "Peter T" <peter_t@discussions wrote:

Inside one sub, I would like to call a function in an add-in, but want
it to work if the add-in is not necessarily referenced in the project.


s = Application.Run("myAddin.xla!fct_name", arg1, arg2)

Inclusion of the addin name may not be necessary if there's no
ambiguity of the procedure name in any open project.


Regards,
Peter T

Thanks. This worked for me. Just curiuos how the syntax would
change if there was ambiguity and I had to specify the module as well?


Normally there shouldn't, couldn't, be any ambiguity of procedure names
within the same project. However you can qualify the procedure name with the
module name and a dot, eg

s = Application.Run("'myAddin.xla'!modName.fct_name", arg1, arg2)

Notice I've also embraced the wb name with apostrophes, necessary if certain
characters are present in the wb name, such as a space.

If you want to go the whole hog you could also include the path to ensure
the addin opens if not already
s = Application.Run("'c:\path\myAddin.xla'!.fct_name", arg1, arg2)

Obviously you'd need to know the path though you wouldn't necessarily need
to hard code it, as above.

Regards,
Peter T


Regards,
Peter T


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
Calling VBA Function João Excel Programming 1 March 18th 07 04:34 AM
Keep function result after removing referenced column Charles in Iraq Excel Worksheet Functions 3 November 16th 06 12:31 PM
SolverOK / SolvOK function does not compile - SOLVER library is referenced Joel Lack Excel Programming 1 September 5th 06 05:58 PM
Can I use a lookup function that pulls referenced cells in multip. SBB Excel Worksheet Functions 0 June 20th 06 04:46 PM
calling a function dmexcel Excel Programming 5 February 23rd 06 12:02 PM


All times are GMT +1. The time now is 01:45 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"