Skip to content

Import components

PetLahev edited this page May 26, 2015 · 5 revisions

When you first open any Office application and going to VBE IDE you will see new Components menu.

Clicking on Import will bring a new form where you can specify from where you want to import components. If you haven't imported/exported any component yet, you will have to specify from where you want to import components. Clicking on Browse… button will bring up a standard folder pick up dialog, choose a folder and hit OK. CM will validate your selection and if it contains at least one valid VBA component (extension is equal *.cls, *.bas) the name of the active project will be saved together with your chosen path to the settings file so next time when you open the same project, the path will be predefined for you.

###VBA Project name The name of your VBA project plays crucial role for the CM add-in, the name of the project is saved along with the selected path. Therefore if you do not name your project and you always use the default VBAProject name, you will have to browse for correct folder again again. I highly recommend you to name your project for everything else than test project.

All the valid components are loaded to the form and you can check/uncheck those you want to import to the active project. Note the selection panel on the top left hand side which make your selection easier. The Selection Panel works as a switcher. One click will check all appropriate components, the second one will uncheck all of them.

Another option available for you is the Override if exists. The default value is true which means that if you import a component that already exists in the active project, the component will be removed and the imported one will replace it (for document type components - ThisWorkbook, ThisDocument etc. - the original text is erased and text from imported component is inserted). If you uncheck the Override if exists, all the imported components will be imported side by side (see issue #7)

When you use CM long enough to export/import at least two projects (two folders), you will be able to choose from known and valid projects from the drop down list. Every project is validated before loading so if you remove any, you won't be able to choose it as a valid project. Once you choose a valid project, all components will be loaded and you can import components from different projects to your active project (how handy is it for your 'framework' components? Very handy!). Btw. selecting a component will bring it's code on the form as well!

Clone this wiki locally