Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-03-2012, 09:20 AM
namedujour
Guest
 
Posts: n/a
Default 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.
Reply With Quote
  #2  
Old 01-04-2012, 12:16 AM
Catalin.B Catalin.B is offline Move macros to new spreadsheet Windows Vista Move macros to new spreadsheet Office 2010 32bit
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

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.
Reply With Quote
  #3  
Old 01-09-2012, 09:49 AM
namedujour
Guest
 
Posts: n/a
Default

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.
Reply With Quote
  #4  
Old 01-09-2012, 11:05 AM
Catalin.B Catalin.B is offline Move macros to new spreadsheet Windows Vista Move macros to new spreadsheet Office 2010 32bit
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

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...
Reply With Quote
Reply

Thread Tools
Display Modes


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
Move macros to new spreadsheet Creating a spreadsheet nickypatterson Excel 1 01-14-2010 03:21 PM
Move macros to new spreadsheet Looking for a specific spreadsheet DivideByZer0 Excel 3 11-10-2009 05:58 PM
Move macros to new spreadsheet Spreadsheet for words Rosie Office 3 06-15-2005 02:27 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:22 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft