Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I share my function with others user easily
I have write a public function how can I share this function with other
Excel user easily....or can I convert it to add-in....for sharing? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I share my function with others user easily
Hi New.microsoft.com,
I have write a public function how can I share this function with other Excel user easily....or can I convert it to add-in....for sharing? Many users tend to put their macros in their personal.xls file. Nothing wrong with that, because that is what it is there for. But what if you like your macros so much you decide others might benefit? You might be tempted to copy your personal.xls onto a floppy and give that to others. Don't! Also don't copy your xlb file to others to give them your toolbars, you will overwrite their customisations.. I would be very distressed if you would come and hijack my personal.xls and excel.xlb files! What you should do is create a new workbook with all your code *and toolbars* and distribute *that* file (maybe saved as add-in). About toolbars: You can attach a toolbar to a workbook. When this workbook is loaded, XL checks if the toolbar is on the system. If not, it copies the toolbar from the workbook to the system. After creating *or changing* the toolbar, you should attach the toolbar to your workbook: - activate the workbook to which you want to attach the toolbar - Rightclick the toolbar, select 'customize' - Click 'Attach' (Toolbars Tab) - If the workbook already contains a toolbar by that name, delete it first by clicking on it on the righthand side and choosing Delete. - Select your toolbar (on the left) and press 'copy' - Save the workbook (optionally: save_as an add-in). Also, You should include code that deletes the toolbar when your workbook or add-in is closed, so that when you deliver a new version of your workbook the new toolbar will be used i.s.o the old one. You can do that in the Thisworkbook module, using the Workbook_beforeClose event: Private Sub Workbook_BeforeClose(Cancel as Boolean) On Error Resume Next 'In case Toolbar is absent Application.CommandBars("YourBarsName").Delete End Sub ============ Veel gebruikers slaan hun persoonlijke macros op in Personal.xls. Daar is niets mis mee, want daarvoor is dit bestand ook bedoeld. Maar wat te doen als je deze macros zo goed vindt, dat je ze aan anderen ter beschikking wilt stellen? Je bent dan genegen jouw personal.xls aan die anderen te geven. Doe dat NIET. Geef ze ook geen kopie van jouw xlb bestand met de knoppenbalken. Je overschrijft namelijk de macros en knoppenbalken van die andere gebruiker(s)! Ik persoonlijk zou tamelijk ontevreden worden als je dat bij mij kwam doen... Wat je wel moet doen is alle code die je aan anderen wilt geven in een apart werkboek kopieren. Attach aan dat werkboek tevens de knoppenbalken die bij die code horen en distribueer dat werkboek, eventueel als invoegtoepassing. Excel bewaart knoppenbalken in een bestand op de harde schijf, genaamd Excel.xlb of Username8.xlb, afhankelijk van de XL versie. Je kunt een knoppenbalk echter toevoegen aan een werkboek (en dus aan een add-in): Rechtsklikken op werkbalk, aanpassen, dan "toevoegen" klikken. Vervolgens werkboek opslaan. Wat gebeurt er nu: ALs het bestand wordt geopend, kijkt XL of er een knoppenbalk in het systeem staat met dezelfde naam. Zo ja, dan doet Excel niets en wordt de "systeem" balk gebruikt. Zo nee, dan wordt de balk van het werkboek gekopieerd naar het systeembestand (excel.xlb). Wil je dus dat jouw knoppenbalk actueel blijft, dan moet je het werkboek voorzien van code dat bij het sluiten de knoppenbalk weghaalt. Bij herladen wordt dan de balk uit het bestand gebruikt. (In de Thisworkbook module) Private Sub Workbook_BeforeClose(Cancel as Boolean) On Error Resume Next Application.Commandbars("JouwKnoppenbalk").Delete End Sub Als je een add-in hebt gemaakt, dan kan je deze gewoon ergens in een zelf te kiezen directory plaatsen. In Excel "installeer" je de addin dan door Tools, add-ins te kiezen (Extra, invoegtoepassingen), op browse te klikken en het bestand op te zoeken. Je kunt dat ook automatiseren, zie bijvoorbeeld mijn Name Manager utility van www.bmsltd.co.uk/mvp. Bekijk de code in "Setup Name Manager.xls". Regards, Jan Karel Pieterse Excel MVP www.jkp-ads.com |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I share my function with others user easily
Hi,
Thank you for replying! The suggestion from Jan is very wonderful. Based on my experience, you can save the function in one workbook directly and copy this file to others. In another way, I'd suggest you can save your excel workbook with the public function as one xla file(add-in). You can insert one module in this workbook and put the function there. Then when other users are using your xla add-in, they can use the code below to run your method. Application.Run "<xlaname.xla!<FunctionName" Please feel free to let me know if you have any further questions. I am standing by to of assistance!e Does this answer your question? Thank you for using Microsoft NewsGroup! Wei-Dong Xu Microsoft Product Support Services Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hiding Worksheets and Unhiding them easily for Novice User | Excel Discussion (Misc queries) | |||
How do I share a workbook and allow user to save? | Excel Discussion (Misc queries) | |||
user cannot access his share workbook on network drive. | Excel Worksheet Functions | |||
i share my copmuter. how can i setup seperate new user account | New Users to Excel | |||
How do I share a custom toolbar with another user? | Excel Discussion (Misc queries) |