Copy Module

Pestomania

Active Member
Joined
May 30, 2018
Messages
333
Office Version
  1. 365
Platform
  1. Windows
Hello, I am trying to use VBA to Export the Module from a Personal Macro Workbook and Import that file into the Active Workbook. I have seen a few that work when it is workbook to workbook but I cannot get them to work from PMW. I am just needing some help. Thank you :)

I didn't put any code because I don't have any right now
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Upvote 0
Did you load the reference before building the actual macro to export.
 
Upvote 0
copied from the reference material I suggested:

Before applying code it's best to load the referenc to the VBA extensiblility library:
- manually : open the VBE Editor: Alt-F11/Menu Bar/ Extra / references/ check 'Microsoft Visual Basic for Application Extensibility 5.3'
- using VBA

Method 'AddFromGuid'
Code:
[COLOR=#00008B][FONT=Tahoma][COLOR=blue]Sub load_reference_1()
ThisWorkbook.VBProject.References.AddFromGuid "{0002E157-0000-0000-C000-000000000046}", 5, 3
end sub[/COLOR]
[/FONT][/COLOR]
Method 'AddFromFile'
Code:
[COLOR=#00008B][FONT=Tahoma][COLOR=blue]Sub Load_reference_2()
ThisWorkbook.VBProject.References.AddFromFile "C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB"
end sub[/COLOR]
[/FONT][/COLOR]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,226,112
Messages
6,189,040
Members
453,521
Latest member
Chris_Hed

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top