MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Apr 3rd, 2002, 07:21 AM   #1
AllenL
Board Regular
 
Join Date: Mar 2002
Posts: 67
Default

Is it possible to assign one macro to a button in toolbar to run different workbooks??? So each workbook can run the macro independently and not to rely on the other workbooks.
I copy the macro's VBA code to each workbook. However, when I run the macro, it still open the workbook which the macro is last assigned by.
What should I do??? Please HELP

Thanks in advance
AllenL is offline   Reply With Quote
Old Apr 3rd, 2002, 07:57 AM   #2
smozgur
BatCoder
 
Join Date: Feb 2002
Location: Turkey
Posts: 764
Default

Hi Allen,

There is a file called as Personal.xls. It is personal workbook and it opened everytime you open a workbook, and it is hidden as default. You can store your macros in it so you dont need to copy macros in all workbooks that you want to use in. To create a personal.xls if you have not already just Tools_Macro_RecordNewMacro and select Personal Macro Workbook for "store macro in" choice. After recording a simple macro by this way you can goto to VBE and see the Personal.xls file. Just move your macros there.

Thats it.

Regards


smozgur is offline   Reply With Quote
Old Apr 3rd, 2002, 08:12 AM   #3
AllenL
Board Regular
 
Join Date: Mar 2002
Posts: 67
Default

Where is this Personal.XLS file saved?
After I copy the macro to the Personal.XLS, do I still need the VBA code that I copy in each workbook??
Thanks in advance
AllenL is offline   Reply With Quote
Old Apr 3rd, 2002, 08:20 AM   #4
smozgur
BatCoder
 
Join Date: Feb 2002
Location: Turkey
Posts: 764
Default

It should be saved in C:WINDOWSApplication DataMicrosoftExcelXLSTART when you first create a macro in Personal Macro Book but you dont need to find that file because it would be opened automaticially. Just record a macro by selecting Store Macro In Personal Macro Book. Then goto VBE. You will see what i meant.

Then no, you dont need to copy all common macros anymore.

Regards
smozgur is offline   Reply With Quote
Old Apr 3rd, 2002, 08:21 AM   #5
AJ
Board Regular
 
Join Date: Mar 2002
Location: =ActiveCell.Address
Posts: 478
Default

Hiya,

It really depends on your set-up, but it's likely to be something like:
C:program filesmicrosoft officeofficexlstart
or similar.
The beauty of the personal.xls is that it loads it everytime you start Excel (like a normal.dot in Word).

So you can just keep stuff in there and not worry about copying code.

Rgds
AJ
AJ is offline   Reply With Quote
Old Apr 3rd, 2002, 08:26 AM   #6
AllenL
Board Regular
 
Join Date: Mar 2002
Posts: 67
Default

If my company need to distribut all the workbooks to the other companies by e-mail. Do I need to copy that Personal.xls file to make the macro run?
Thanks in advance
AllenL is offline   Reply With Quote
Old Apr 3rd, 2002, 12:41 PM   #7
smozgur
BatCoder
 
Join Date: Feb 2002
Location: Turkey
Posts: 764
Default

Oh no,

I mean yes it is possible but not right way i think, distributing your personal.xls, because their personal.xls files would be destroyed and/or you maynot want to distribute all your personal macros. You should better write a macro which transfers these macros into the document which would be shared when you want to send them. Or if it is not problem that all personal macro books are same then you can send also personal.xls


smozgur is offline   Reply With Quote
Old Apr 3rd, 2002, 01:20 PM   #8
AllenL
Board Regular
 
Join Date: Mar 2002
Posts: 67
Default

If I only have one macro in Personal.xls. Is it a good idea to just send the Personal.xls???
When the user receive the Personal.xls, does it have to be put into the XLSTART folder to work, or doesn't matter where the user put it??
Thanks in advance
AllenL is offline   Reply With Quote
Old Apr 3rd, 2002, 01:27 PM   #9
daleyman
Board Regular
 
Join Date: Mar 2002
Location: London, UK
Posts: 167
Default


this would be fustrating for the end users, to have to go and save a file to that specific file location, unless you want to distribute it so that everyone has the "always on the toolbar" button, in which case you would have to issue instructions or put a macro in the personal.xls to set this up for your users. if you're going to do this might as well put some code in the personal.xls to go save it to the write location, just make sure you cover your bases as different operating systems or versions of excel probably use different folders for this.

if it just for use in the workbook, then i would put the code in the workbook and put a button on the sheet or something like that. I have personally never needed to distribute a personal.xls, except maybe to help out the guy sitting beside me, for general distribution i would always build a self contained workbook, with menu page and buttons on that page.
daleyman is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 08:16 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes