Solved

After I import a macro into another version of Excel on a differnt computer how do I save it?

Posted on 2011-09-13
5
263 Views
Last Modified: 2012-05-12
I have exported a macro from an older computer with Excel 2003. I then imported it into a new computer with Excel 2010. I imported successfully. The problem is how do I save it for future use??? When I close Excel I get a “do you want to save book1” or something like that and I say no. When I reopen Excel the Macro’s not there but I don’t think I want to save Book1. I know it something to do with saving it to the personal.xls or something like that!

Thanks
0
Comment
Question by:Dan Purcell
5 Comments
 
LVL 14

Expert Comment

by:peetjh
ID: 36530087
Save the file as.xlsm (Macro Enabled Workbook) in the save as dialog box.
0
 
LVL 17

Expert Comment

by:andrewssd3
ID: 36530223
If you have imported it into your personal.xlsb (by right clicking on its project in the project explorer in VBA and selecting Import), you need to save your personal.xlsb.  Excel should prompt you to do this when you close it down, in which case say you want to save it.  You're right you do not want to save Book1.  You can explicitly save personal.xlsb by double clicking on your new module to edit it so it is active in the window, then clicking the Save icon in the VBA window toolbar.
0
 
LVL 4

Expert Comment

by:SafetyFish
ID: 36530253
If you wanted to save just the module itself, you could right click it in the Project Tree of the Developer View (alt+f11) and directly save the code as a .bas file. Then you can easily import it into any workbook you want without having to save a whole workbook.

Peetjh's solution may or may not be better for you. Macros stay with the workbooks they are created, editted, or imported in as long as the workbook is saved with it. However, if you don't want to save the workbook and just the macro code, saving a .bas may be more flexible for you.
0
 
LVL 17

Accepted Solution

by:
andrewssd3 earned 500 total points
ID: 36530263
If you did not get the prompt to save it, perhaps you did not already have a personal.xlsb and you actually imported it somewhere else.  You don't have a personal.xlsb by default.  The easiest way to get one is to record a trivial macro, and say Store Macro in Personal Macro Workbook.  This will create a new personal.xlsb - then look for this in the project explorer on the left hand side of the VBA window, and right click on it to Import your code.
0
 

Author Closing Comment

by:Dan Purcell
ID: 36530629
You all were so very helpful! I love this site. The computer didn't have a personal.xlsb yet, so after recording a macro and saving it I was able to import and save the new one.


Thanks to you all
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question