![]() |
Make Function Accessible only from VBA
Hi,
I have a few UDFs that should only be callable from VBA (they are meaningless as spreadsheet functions). Does anybody know how to make a UDF invisible to the spreadsheet, but visible to any/all VBA modules? I don't think the "Private" designation is appropriate because it makes the UDF invisible to all other VBA modules. An example of this would be the MsgBox function, which is callable from any VBA module, but not callable directly from a spreadsheet. Thanks in advance for any help. Ryan |
Make Function Accessible only from VBA
Hi Ryan,
Using the Option Private Module directive will prevent public functions from being displayed in the function wizard. If the user knows the exact name and argument list they can still enter the function in a cell and it will get called, but this isn't normally a problem. I'm pretty sure the only way to prevent any use in a worksheet function is to either make your functions private or wrap them in a class module and use them in your VBA project through an instance of the class. -- Rob Bovey, MCSE, MCSD, Excel MVP Application Professionals http://www.appspro.com/ * Please post all replies to this newsgroup * * I delete all unsolicited e-mail responses * "Ryan Poth" wrote in message ... Hi, I have a few UDFs that should only be callable from VBA (they are meaningless as spreadsheet functions). Does anybody know how to make a UDF invisible to the spreadsheet, but visible to any/all VBA modules? I don't think the "Private" designation is appropriate because it makes the UDF invisible to all other VBA modules. An example of this would be the MsgBox function, which is callable from any VBA module, but not callable directly from a spreadsheet. Thanks in advance for any help. Ryan |
All times are GMT +1. The time now is 10:19 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com