![]() |
Access Functions & Subprocedures in an Add-In
I have written several functions and subprocedures in a spreadsheet file. I
saved the file as an .XLA and then loaded the add-in, but chose not to copy it to my local add-ins folder. I read somewhere if you want to have a macro run code you have written it must be a subprocedure. So I did that. However, when I go to the Macro menu or create macro menu the subprocedures are not available. What's weird is - I can write formulas in any workbook I open and I can reference the code I wrote as a function and the formulas work great. So why can't I 'see' the subprocedures to run macros? Any help is greatly appreciated. Seth |
Access Functions & Subprocedures in an Add-In
Actually, that is by design. Typically when you distribute an XLA, you
don't want users just running the macros unless they are supposed to. I'd suggest that you may want to add a menu structure or toolbar to your workbook, and John Walkenbach has some great examples of how to do that he http://j-walk.com/ss/excel/tips/commandbars.htm Note that if you are using Excel 2007, and menus will show up in a special section of the menu, as the user interface has been redesigned to use the Ribbon, rather than commandbars. HTH, Ken Puls, CMA - Microsoft MVP (Excel) www.excelguru.ca Seth Schwarm wrote: I have written several functions and subprocedures in a spreadsheet file. I saved the file as an .XLA and then loaded the add-in, but chose not to copy it to my local add-ins folder. I read somewhere if you want to have a macro run code you have written it must be a subprocedure. So I did that. However, when I go to the Macro menu or create macro menu the subprocedures are not available. What's weird is - I can write formulas in any workbook I open and I can reference the code I wrote as a function and the formulas work great. So why can't I 'see' the subprocedures to run macros? Any help is greatly appreciated. Seth |
Access Functions & Subprocedures in an Add-In
Thank you. I have briefly read through the suggested link and this is a far
better answer to my question than I could have hoped for. Seth "Ken Puls" wrote: Actually, that is by design. Typically when you distribute an XLA, you don't want users just running the macros unless they are supposed to. I'd suggest that you may want to add a menu structure or toolbar to your workbook, and John Walkenbach has some great examples of how to do that he http://j-walk.com/ss/excel/tips/commandbars.htm Note that if you are using Excel 2007, and menus will show up in a special section of the menu, as the user interface has been redesigned to use the Ribbon, rather than commandbars. HTH, Ken Puls, CMA - Microsoft MVP (Excel) www.excelguru.ca Seth Schwarm wrote: I have written several functions and subprocedures in a spreadsheet file. I saved the file as an .XLA and then loaded the add-in, but chose not to copy it to my local add-ins folder. I read somewhere if you want to have a macro run code you have written it must be a subprocedure. So I did that. However, when I go to the Macro menu or create macro menu the subprocedures are not available. What's weird is - I can write formulas in any workbook I open and I can reference the code I wrote as a function and the formulas work great. So why can't I 'see' the subprocedures to run macros? Any help is greatly appreciated. Seth |
All times are GMT +1. The time now is 12:19 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com