Re: Copy a module from add-in to active doc by Bear
Bear
Fri Jun 30 08:29:01 CDT 2006
Jezebel
That's exactly what I'm trying to do -- add code programatically. And after
much research, I came to the conclusion that the inability to copy code
programatically (using the organizer object) was, indeed, intended operation,
and a virus safeguard.
Maybe you can offer some suggestions for an alternative approach.
I'm setting up the target document to display variables stored in a table in
another document. When the target document opens, I need to load the table
into an array for reference during the session.
I could set up the document by attaching a template that already has an
auto-open macro, but then the original template wouldn't be available, etc. I
just prefer the idea of putting my code in an add-in, copying a toolbar that
accesses that code into the target document, etc.
Any ideas?
Bear
> You'reon the right track: open the add-in, then you can copy the module.
> Unless you're trying to do this programmatically, in which case you're
> almost certainly on the wrong track: manipulating code through code is
> tricky to say the least, and precluded entirely in many security set-ups.
>
>
>
>
> "Bear" <Bear@discussions.microsoft.com> wrote in message
> news:5CEA05C0-F034-4D3D-B39A-C61A39AD8D78@microsoft.com...
> > How do I copy a macro module from an add-in to the active document? (I'm
> > trying to insert an auto-open macro by copying it into the doc.)
> >
> > I've used the Application.OrganizerCopy method to copy a toolbar that way,
> > but it fails if I try to copy a module. And if you open the organizer and
> > examine an add-in, you can't see the modules either.
> >
> > You can only see the modules in the add-in when it's actually open.
> >
> > Any help will be appreciated.
> >
> > Bear
>
>
>