#1
|
|||
|
|||
Move macros to new spreadsheet
I've created a new 2012 .xlsm spreadsheet with data from the 2011 .xlsm spreadsheet. The macro buttons on the toolbar work, but only because they open up last year's spreadsheet and run from there. The hot keys do NOT work unless the old spreadsheet is open.
I went to the Developer tab and tried to edit them by renaming them "2012" but the new name didn't stick. I don't want to re-record everything. Is there a way to simply move the macros to another worksheet and have everything work? I tried copy/pasting the VB code from one spreadsheet to the other, and that didn't seem to work. |
#2
|
|||
|
|||
Have you tried to create an add-in with your macros (just save a worksheet containing your macros as excel add-in .xla in save as menu), then place it in excel add-ins folder, or startup folder. Then refer to this add-in macros to put buttons on the toolbar. this way, the toolbar macro buttons will not open macros from other worksheets, because this addin containing macros will allways start when excel starts.
|
#3
|
|||
|
|||
Thank you! That kind of worked.
However, I saved the XLAM add-in with the macros from a password-protected sheet. When I clicked the icons Excel asked for that password and tried to launch that worksheet. The short keys, however, worked immediately and didn't do that. I tried to remove the add-in from the spreadsheet, and couldn't find a way to do that. There is no "Delete" in the View and Manage Microsoft Add-ins dialog. So, once you put it there, there it is - unless you remove add-ins somewhere else. I closed the original spreadsheet and created a new one - the password-protected add-in was attached to the new spreadsheet as well. I closed Excel and reopened it, and the next new spreadsheet I tried to create had that add-in. So, apparently an add-in you attach to one spreadsheet attaches to every new sheet from that point on. Is that correct? Unfortunately, I need to make it go away so I can set something up without passwords. I'll poke around in Help and see if I can figure that out, unless you have a quick fix...? Apparently I can't actually display the XLAM sheet to turn off the password. Nothing launches when you try to open it. I wanted to retest this by creating the add-in from a spreadsheet that had no password. However, the fact that the original add-in attaches to new spreadsheets means I can't. I can live with the short keys, but it just seems like something isn't working correctly. Did I miss something? EDITED: I figured out how to disable the add-in. However, when I created the new XLAM add-in from the spreadsheet that has no password protection, the new add-in didn't display on the dialog. I looked and found it in the same AddIns directory as the first add-in, which DOES display in the dialog. So it exists, and when I did a Save As again, it asked me if I wanted to replace the existing file. Still, I can't access it to attach it. So I don't know what's going on, or why it's working this way. I guess I'll just re-record the macros. |
#4
|
|||
|
|||
Just delete the add-in with password from the add-ins folder, and create a new one. It's harder to convert an add-in back to excel to remove protection. But before that, with excel opened, you should be able to copy the vba modules to a new excel file to save as add-in...
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Moving spreadsheet to Windows 7 | don madsen | Excel | 1 | 09-30-2011 03:37 AM |
vba Code to Print Spreadsheet to PDF | OTPM | Excel Programming | 3 | 05-25-2011 08:22 AM |
Creating a spreadsheet | nickypatterson | Excel | 1 | 01-14-2010 03:21 PM |
Looking for a specific spreadsheet | DivideByZer0 | Excel | 3 | 11-10-2009 05:58 PM |
Spreadsheet for words | Rosie | Office | 3 | 06-15-2005 02:27 PM |