Distributing a Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a huge problem at work. I am new to VBA (about a week or so) and I
need to get a macro out to about 8 different people that someone else has
developed. He created it and then went on vacation for a week (nice guy,
huh?) Well, he did install it on one computer (the guinea pig), but I can't
seem to figure out how or where he did it. It is a macro that only runs when
you forward an e-mail, so I couldn't see the code on the guinea pig until I
had clicked forward on a dummy message. I thought I had it figured out then,
but now I can't get the the VBeditor from the same spot. (Why? I don't know).
So, anyway, this code is fairly foreign to me at this point, and I keep
getting a compile error when trying to run it on my computer, even though the
guinea pig works fine.

There are three different files that I see, but I don't know where to load
them.

The first is the main macro. It is a .bas file
The next two seem to be declarations:
2 is a .vbp
The beginning of the code looks like this

Type=Exe
Module=NewMacros; BiscomForward.ba
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\system32\stdole2.tlb#OLE Automation
Startup="Sub Main"
Command32=""
Name="Project1"
....

3 is a .vbw
It's code is simply this:

NewMacros = 22, 29, 621, 481, Z

What the crap do I do with these? I copied and pasted the first file into
my VBeditor, but I don't know what I need to do with the other two.
 
Am Tue, 27 Dec 2005 12:09:36 -0800 schrieb sweens319:

You´re missing something. *.vbp and *.vbw are VB project files and aren´t
used in VBA projects. Your *.vbp content indicates that it´s a standard exe
- so it can´t be an Add-In. Additionally because there´s only a standard
module (*.bas) and no class module (*.cls or *.frm) that exe isn´t able to
receive events. That is the code in the *.bas can´t be triggered directly by
forwarding an e-mail.

Did you look into the VBA editor already? Please open Outlook and press
ALT+F11. Open the module "ThisOutlookSession". If there´s really something
running then it starts in ThisOutlookSession and either the *.bas modul is
also added to that project (use the project explorer - CTRL+R - to see all
modules) or its content is copied into ThisOutlookSession.

For "distributing" the VBA project you can export all modules and import
them at the other computer. Note: ThisOutlookSession will be imported as
ThisOutlookSession1. You need to copy its content then into the original
ThisOutlookSession.

Another method is to copy all the project file (*.otm). The disadvantage is
that OL can handle one VBA project only, i.e. existing code on the target
machine would be overwritten.
 
Hi,
Your not supposed to copy & paste from a .bas file. (unless you know what
you are doing)

Delete your module in the VBA editor. Or delete the code. Otherwise you will
end up with duplicate names.

Then click on the "modules" icon in the project pane. It's usually the top
left window.

Right click and select "import file.."

Navigate to the .bas file and double click on it.
 
I tried that, and it didn't work out right. Apparently, this guy has his own
reference library that he created called Normal.dot. I figured out a little
bit more from above. I set the security permissions on guinea pig, and was
able to view the editor. Now this computer has, on it's C: drive under
Microsoft/Templates the Normal.dot (MSWord template) file.

Here is the structure of the guinea pig computer in VBeditor.

- Normal
- Microsoft Word Objects
This Document
- Modules
NewMacros --> this contains the code from the .bas file
- Project (Document1)
- Microsoft Word Objects
This Document
- References
Reference to Normal --> This contains no code and properties
give no help

Then, under the references, I have VBA; Word 11.0; OLE Automation; NORMAL;
Office 11.0

All this info is only visible when I click forward on a message and then go
to the VB editor, not from the main outlook window.

Can I just put Normal.dot onto a disk and put into the c: drive of each
computer (in the proper folder)....and import the .bas file. I'm just
extremely confused here. How do I create a new project called Normal as in
the structure above? What do I need to do with the Reference to Normal? Do I
copy the file to c: drive and then browse under references?
 
Hi,
Normal.dot is a standard Word file. If you change the default font or other
settings, Word creates normal.dot.
It also possible to store macros in normal.dot. This makes them available to
any and all Word documents.
Make the macros "global". Word is closely linked to Outlook for formatting,
spell checking etc.

You are obviously in way over your head.
I suggest you wait until the programmers vacation is over.
 
Am Wed, 28 Dec 2005 15:24:33 -0500 schrieb jaf:

You are obviously in way over your head.
I suggest you wait until the programmers vacation is over.

Full ACK!

Otherwise, his job to clean up the mess would probably take more than a week
:-)
 
Well, actually, I wasn't in over my head, it was just a simple little thing
that needed to be changed, otherwise I was doing everything right. If anyone
else has a problem like this, check to see what your references are. If
Microsoft Word is supposed to be referenced, ie Normal.dot, then:

Make sure you set your e-mail editor to Microsoft Word, then it will work
just fine.

Had I already had my e-mail editor set to Word, the rest of my steps would
have been sufficient to complete this task.
 
Am Mon, 9 Jan 2006 12:58:02 -0800 schrieb sweens319:

Ok, for all the readers here: Whatever you did to solve your problem, it´s
not recommended to overwrite other user´s Normal.dot.
 
Correct. I didn't overwrite anything in Normal.dot. I was just confused as
to where the reference was coming from since I didn't have Word as my e-mail
editor.
 
Back
Top