View Single Post
 
Old 07-25-2017, 07:30 AM
mihnea96 mihnea96 is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Apr 2017
Posts: 26
mihnea96 is on a distinguished road
Default Importing .frm and .bas files using code

Hi,

i'm trying to make a word document that when opened installs (imports) the macros into the computer, but i've been trying to use the code bellow and kept getting the error "Method 'Import' of object'_VBComponents failed". could you help me out, please?
i've wanted to do this from Excel as i have other installs there as well and it would've been easier to do it from only one file, but it doesn't work.

code:
ActiveDocument.VBProject.VBComponents.Import Environ("SystemDrive") & Environ("HomePath") &...........


thanks in advance!
Reply With Quote