• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 272
  • Last Modified:

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

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
Dan Purcell
Asked:
Dan Purcell
1 Solution
 
JPIT DirectorCommented:
Save the file as.xlsm (Macro Enabled Workbook) in the save as dialog box.
0
 
andrewssd3Commented:
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
 
SafetyFishCommented:
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
 
andrewssd3Commented:
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
 
Dan PurcellManagerAuthor Commented:
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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now