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
260 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

867 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now