Moving macros and code to a new computer

dasadler
5StarLounger
Posts: 889
Joined: 25 Jan 2010, 16:26
Location: Garden Grove, CA 92844 USA

Moving macros and code to a new computer

Post by dasadler »

I have lots of macros in Excel, word, and outlook. All 2007. is there a simple way to copy them all and move them from an old machine to a new machine? I hate the thought of retyping everything in again.
Don

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Moving macros and code to a new computer

Post by Rudi »

Unfortunately, you are limited to one module at a time....

You can also export the modules (unfortunately only one at a time)
Right click a module and choose Export File (saves as a .bas file)
Copy them to a flash drive or cloud drive
In the destination app, right click the Project and Import File
Point to the appropriate .bas files and Import
BTW: It goes faster if you just drag it out of the VB Editor onto the flash drive or cloud drive (less mouse clicks)
You can also import it by drag and drop (onto the appropriate project) on the other PC

PS: Don't mix them up. Ensure you remember which modules are for which App and which file
I'd drag (or export them to folders etc...)
Last edited by Rudi on 30 Sep 2013, 05:21, edited 1 time in total.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
HansV
Administrator
Posts: 78446
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Moving macros and code to a new computer

Post by HansV »

All macros in Outlook are stored in a file named VBAProject.OTM, in

C:\Users\<username>\AppData\Roaming\Microsoft\Outlook

under Windows Vista or later, or in

C:\Documents and Settings\<username>\Application Data\Microsoft\Outlook

under Windows XP.

You can copy the .OTM file from this location on the old computer to the corresponding location on the new one.

"Global" macros in Excel are stored in a file called Personal.xlsb, stored in

C:\Users\<username>\AppData\Roaming\Microsoft\Excel\XLSTART

under Windows Vista or later, or in

C:\Documents and Settings\<username>\Application Data\Microsoft\Excel\XLSTART

under Windows XP. Copy this file too.

Warning: AppData / Application Data is a hidden folder. You must show hidden files and folders to be able to see it.
Best wishes,
Hans