ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to use UDF from Add-in in VBA (https://www.excelbanter.com/excel-programming/343866-how-use-udf-add-vba.html)

Andibevan[_4_]

How to use UDF from Add-in in VBA
 
Hi All,

I have a UDF that is contained in an add-in I have created myself
(MyAddin.xla)

I have been trying to utilise the UDF as follows:-

Var_TXT = application.worksheetfunction.myextract(Var_Source _Fold,1,"B","\")

But keep getting this error "Object doesn't support this property or method"

Any pointers?

Ta

Andi



Bob Phillips[_6_]

How to use UDF from Add-in in VBA
 
Try this

Application.Run "addin_name.xla!myextract", Var_Source_Fold,1,"B","\"

or set a reference to your addin project and call directly.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in message
...
Hi All,

I have a UDF that is contained in an add-in I have created myself
(MyAddin.xla)

I have been trying to utilise the UDF as follows:-

Var_TXT =

application.worksheetfunction.myextract(Var_Source _Fold,1,"B","\")

But keep getting this error "Object doesn't support this property or

method"

Any pointers?

Ta

Andi





Tushar Mehta

How to use UDF from Add-in in VBA
 
It is true that from the UI perspective a UDF appears to be part of
XL's functions. However, it is not really so. It is part of the XLA
that contains it. Adapt the idea at
How to use a class (object) from outside of the VBA project in which it
is declared
http://support.microsoft.com/default...b;en-us;555159

specifically, see how the function New_clsEmployee is accessed
externally. If the rest of the stuff about classes and objects is
confusing, just ignore it.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article , Andibevan@notehere-
hotmail.com says...
Hi All,

I have a UDF that is contained in an add-in I have created myself
(MyAddin.xla)

I have been trying to utilise the UDF as follows:-

Var_TXT = application.worksheetfunction.myextract(Var_Source _Fold,1,"B","\")

But keep getting this error "Object doesn't support this property or method"

Any pointers?

Ta

Andi




Tom Ogilvy

How to use UDF from Add-in in VBA
 
Only a subset of built in Excel functions are methods of the
WorksheetFunction object.

Var_TXT = application.Run( "AddinName.XLA!myextract",
Var_Source_Fold,1,"B","\")

--
Regards,
Tom Ogilvy


"Andibevan" wrote in message
...
Hi All,

I have a UDF that is contained in an add-in I have created myself
(MyAddin.xla)

I have been trying to utilise the UDF as follows:-

Var_TXT =

application.worksheetfunction.myextract(Var_Source _Fold,1,"B","\")

But keep getting this error "Object doesn't support this property or

method"

Any pointers?

Ta

Andi





Andibevan[_4_]

How to use UDF from Add-in in VBA
 
Thanks All - much appreciated

"Tom Ogilvy" wrote in message
...
Only a subset of built in Excel functions are methods of the
WorksheetFunction object.

Var_TXT = application.Run( "AddinName.XLA!myextract",
Var_Source_Fold,1,"B","\")

--
Regards,
Tom Ogilvy


"Andibevan" wrote in message
...
Hi All,

I have a UDF that is contained in an add-in I have created myself
(MyAddin.xla)

I have been trying to utilise the UDF as follows:-

Var_TXT =

application.worksheetfunction.myextract(Var_Source _Fold,1,"B","\")

But keep getting this error "Object doesn't support this property or

method"

Any pointers?

Ta

Andi







Andibevan[_4_]

How to use UDF from Add-in in VBA
 
I have tried your solution and am getting a runtime error 1004 saying it
can't find the add-in - Do I need to specify the path and add-in name or
just the add-in file name?

Ta

Andi

"Bob Phillips" wrote in message
...
Try this

Application.Run "addin_name.xla!myextract", Var_Source_Fold,1,"B","\"

or set a reference to your addin project and call directly.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in message
...
Hi All,

I have a UDF that is contained in an add-in I have created myself
(MyAddin.xla)

I have been trying to utilise the UDF as follows:-

Var_TXT =

application.worksheetfunction.myextract(Var_Source _Fold,1,"B","\")

But keep getting this error "Object doesn't support this property or

method"

Any pointers?

Ta

Andi







Tom Ogilvy

How to use UDF from Add-in in VBA
 
Do I need to specify the path and add-in name

Not if the addin is loaded.

If it isn't you would.

--
Regards,
Tom Ogilvy


"Andibevan" wrote in message
...
I have tried your solution and am getting a runtime error 1004 saying it
can't find the add-in - Do I need to specify the path and add-in name or
just the add-in file name?

Ta

Andi

"Bob Phillips" wrote in message
...
Try this

Application.Run "addin_name.xla!myextract",

Var_Source_Fold,1,"B","\"

or set a reference to your addin project and call directly.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in message
...
Hi All,

I have a UDF that is contained in an add-in I have created myself
(MyAddin.xla)

I have been trying to utilise the UDF as follows:-

Var_TXT =

application.worksheetfunction.myextract(Var_Source _Fold,1,"B","\")

But keep getting this error "Object doesn't support this property or

method"

Any pointers?

Ta

Andi









Andibevan[_4_]

How to use UDF from Add-in in VBA
 
In my case it was loaded but still threw the error.

"Tom Ogilvy" wrote in message
...
Do I need to specify the path and add-in name


Not if the addin is loaded.

If it isn't you would.

--
Regards,
Tom Ogilvy


"Andibevan" wrote in message
...
I have tried your solution and am getting a runtime error 1004 saying it
can't find the add-in - Do I need to specify the path and add-in name or
just the add-in file name?

Ta

Andi

"Bob Phillips" wrote in message
...
Try this

Application.Run "addin_name.xla!myextract",

Var_Source_Fold,1,"B","\"

or set a reference to your addin project and call directly.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in message
...
Hi All,

I have a UDF that is contained in an add-in I have created myself
(MyAddin.xla)

I have been trying to utilise the UDF as follows:-

Var_TXT =
application.worksheetfunction.myextract(Var_Source _Fold,1,"B","\")

But keep getting this error "Object doesn't support this property or
method"

Any pointers?

Ta

Andi











Tom Ogilvy

How to use UDF from Add-in in VBA
 
All I can do is demonstrate that it works. I will use the analysis
toolpak-VBA function Dec2Bin in the immediate window as an example:


? Application.Run( "ATPVBAEN.XLA!DEC2BIN",123)
1111011

--
Regards,
Tom Ogilvy


"Andibevan" wrote in message
...
In my case it was loaded but still threw the error.

"Tom Ogilvy" wrote in message
...
Do I need to specify the path and add-in name


Not if the addin is loaded.

If it isn't you would.

--
Regards,
Tom Ogilvy


"Andibevan" wrote in message
...
I have tried your solution and am getting a runtime error 1004 saying

it
can't find the add-in - Do I need to specify the path and add-in name

or
just the add-in file name?

Ta

Andi

"Bob Phillips" wrote in message
...
Try this

Application.Run "addin_name.xla!myextract",

Var_Source_Fold,1,"B","\"

or set a reference to your addin project and call directly.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in message
...
Hi All,

I have a UDF that is contained in an add-in I have created myself
(MyAddin.xla)

I have been trying to utilise the UDF as follows:-

Var_TXT =
application.worksheetfunction.myextract(Var_Source _Fold,1,"B","\")

But keep getting this error "Object doesn't support this property

or
method"

Any pointers?

Ta

Andi













Andibevan[_4_]

How to use UDF from Add-in in VBA
 
Thanks Tom - I will have more of a play - as you said - I can always set a
reference as a workaround for the moment.

Ta

Andi

"Tom Ogilvy" wrote in message
...
All I can do is demonstrate that it works. I will use the analysis
toolpak-VBA function Dec2Bin in the immediate window as an example:


? Application.Run( "ATPVBAEN.XLA!DEC2BIN",123)
1111011

--
Regards,
Tom Ogilvy


"Andibevan" wrote in message
...
In my case it was loaded but still threw the error.

"Tom Ogilvy" wrote in message
...
Do I need to specify the path and add-in name

Not if the addin is loaded.

If it isn't you would.

--
Regards,
Tom Ogilvy


"Andibevan" wrote in message
...
I have tried your solution and am getting a runtime error 1004

saying
it
can't find the add-in - Do I need to specify the path and add-in

name
or
just the add-in file name?

Ta

Andi

"Bob Phillips" wrote in message
...
Try this

Application.Run "addin_name.xla!myextract",
Var_Source_Fold,1,"B","\"

or set a reference to your addin project and call directly.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in message
...
Hi All,

I have a UDF that is contained in an add-in I have created

myself
(MyAddin.xla)

I have been trying to utilise the UDF as follows:-

Var_TXT =
application.worksheetfunction.myextract(Var_Source _Fold,1,"B","\")

But keep getting this error "Object doesn't support this

property
or
method"

Any pointers?

Ta

Andi















Bob Phillips[_6_]

How to use UDF from Add-in in VBA
 
Try the other suggestion Andi, set a reference and see if that works.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in message
...
In my case it was loaded but still threw the error.

"Tom Ogilvy" wrote in message
...
Do I need to specify the path and add-in name


Not if the addin is loaded.

If it isn't you would.

--
Regards,
Tom Ogilvy


"Andibevan" wrote in message
...
I have tried your solution and am getting a runtime error 1004 saying

it
can't find the add-in - Do I need to specify the path and add-in name

or
just the add-in file name?

Ta

Andi

"Bob Phillips" wrote in message
...
Try this

Application.Run "addin_name.xla!myextract",

Var_Source_Fold,1,"B","\"

or set a reference to your addin project and call directly.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in message
...
Hi All,

I have a UDF that is contained in an add-in I have created myself
(MyAddin.xla)

I have been trying to utilise the UDF as follows:-

Var_TXT =
application.worksheetfunction.myextract(Var_Source _Fold,1,"B","\")

But keep getting this error "Object doesn't support this property

or
method"

Any pointers?

Ta

Andi













Andibevan[_4_]

How to use UDF from Add-in in VBA
 
Tried that and it works fine - I find the problem with setting references
like that is that it limits the portability of the spreadsheet but it may be
that I am missing a trick.

Thanks

Andi

"Bob Phillips" wrote in message
...
Try the other suggestion Andi, set a reference and see if that works.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in message
...
In my case it was loaded but still threw the error.

"Tom Ogilvy" wrote in message
...
Do I need to specify the path and add-in name

Not if the addin is loaded.

If it isn't you would.

--
Regards,
Tom Ogilvy


"Andibevan" wrote in message
...
I have tried your solution and am getting a runtime error 1004

saying
it
can't find the add-in - Do I need to specify the path and add-in

name
or
just the add-in file name?

Ta

Andi

"Bob Phillips" wrote in message
...
Try this

Application.Run "addin_name.xla!myextract",
Var_Source_Fold,1,"B","\"

or set a reference to your addin project and call directly.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in message
...
Hi All,

I have a UDF that is contained in an add-in I have created

myself
(MyAddin.xla)

I have been trying to utilise the UDF as follows:-

Var_TXT =
application.worksheetfunction.myextract(Var_Source _Fold,1,"B","\")

But keep getting this error "Object doesn't support this

property
or
method"

Any pointers?

Ta

Andi















Bob Phillips[_6_]

How to use UDF from Add-in in VBA
 
It shouldn't, as long as the target machine has the add-in installed. The
reference will move with the spreadsheet.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in message
...
Tried that and it works fine - I find the problem with setting references
like that is that it limits the portability of the spreadsheet but it may

be
that I am missing a trick.

Thanks

Andi

"Bob Phillips" wrote in message
...
Try the other suggestion Andi, set a reference and see if that works.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in message
...
In my case it was loaded but still threw the error.

"Tom Ogilvy" wrote in message
...
Do I need to specify the path and add-in name

Not if the addin is loaded.

If it isn't you would.

--
Regards,
Tom Ogilvy


"Andibevan" wrote in message
...
I have tried your solution and am getting a runtime error 1004

saying
it
can't find the add-in - Do I need to specify the path and add-in

name
or
just the add-in file name?

Ta

Andi

"Bob Phillips" wrote in

message
...
Try this

Application.Run "addin_name.xla!myextract",
Var_Source_Fold,1,"B","\"

or set a reference to your addin project and call directly.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Andibevan" wrote in message
...
Hi All,

I have a UDF that is contained in an add-in I have created

myself
(MyAddin.xla)

I have been trying to utilise the UDF as follows:-

Var_TXT =

application.worksheetfunction.myextract(Var_Source _Fold,1,"B","\")

But keep getting this error "Object doesn't support this

property
or
method"

Any pointers?

Ta

Andi


















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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com