Using morefunc in VBA Subs/Functions

looping

New Member
Joined
Jun 10, 2011
Messages
18
Hello,

I want to use Morefunc within VBA, but I only get it to work within the Excel Interface.

Morefunc is (correctly?) installed, both Morefunc and Morefunc12 are checked at "Excel-Options>Add-Ins>Active Application Add-Ins" (I am not 100% sure whether this are the correct menue names because I had to translate into english).

Actually, I can use Morefunc within Excel. For example, writing "Filename()" into a random cell returns the workbook's name.

However, calling "Filename()" with VBA doesn't work:
Code:
Dim strTest As String 
strTest = Application.FileName
Instead, I get Error 438: Object does not support this attribute or function

In other forums, using "strTest = FileName()" respectively "Application.Run(FileName)" is suggested but both return the error message "error during compilation: function or sub not defined"

So, I have two questions:
1) How do you call morefunc functions correctly in VBA? I assume there are several correct ways, but some confirmation would be good to eliminate one possible source of error
2) How can I check whether morefunc is correctly installed? (Since this is the only other source of error I can think of)

Thanks in advance!
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Hi. Can I ask whether Filename is the only Morefunc function that you want to call from VBA? If so, you should consider simply using the ThisWorkBook object, like:

ThisWorkBook.Name
 
Upvote 0
Hi Glenn,

thanks for the answer.

Actually, I am primarily interested in MInverse.Ext, MDeterm.Ext and MMult.Ext (I need to process matrices bigger than 52x52).

However, I tried several Morefunc-functions and I could not call any using VBA (calling them within Excel works). So I decided "Filename" would be the best choice for an example.
 
Upvote 0
I don't use Morefunc, but have you set a reference in the VBE? (Tools > References > ...)
 
Upvote 0
I tried this example with UniqueValues
Code:
Sub testmorefunc()
Set DataInput = Range("A1:A4")
OutputArray = Run([UniqueValues], DataInput, 1)
MsgBox Join(OutputArray , ",")
End Sub
... and it works fine.

Does that help?
 
Upvote 0
Hi Glenn,

it works! :)

Thanks, you were a really great help!

PS: I already tried "Run" but without the square brackets. What do they exactly cause? (I also want to understand the solution)
 
Upvote 0
Square brackets do an evaluate on the expression within, like:
MsgBox [A1]
shows the value of cell A1.
 
Upvote 0

Forum statistics

Threads
1,224,509
Messages
6,179,192
Members
452,893
Latest member
denay

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top