I did that. I assume that Option Explicit goes in the Declarations section of
the module. The behavior is exactly the same. When I try to compile the code,
it doesn't seem like anything happens (other that "Complile Spamdeath" (my
project name) turns grey after running "Compile Spamdeath once). No errors
pop up or anything. If I add the statement "bob=mickeymouse(), then it shows
me that mickeymouse() doesn't exist, so I'm guessing that the sub or function
not defined error is a red herring for the actual problem.
All I have in my project is this:
Option Explicit
Public Sub SpamDeath()
UserForm1.Show
End Sub
Plus a user form with some ListBoxes and CommandButtons and the code
associated with those.
I am throroughly confused here. I do a lot of VB programming, but this is my
first macro through MSOffice attempt since a much earlier version of Excel.
It may be worth noting that I went into the VB Editor first to create the
project and then later did the "Create" step from the macro directory at
which point I added the line of code to load my form. Perhaps that was wrong?
"Eric Legault [MVP - Outlook]" wrote:
Turn on Option Explicit and try compiling your code - it'll tell you where
there are calls for functions or procedures that don't exist.
--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/
"adenke" wrote:
I have created a Macro in VB in Outlook 2007, and when I run it, I get a "Sub
or function not defined" error message box. I have not been able to
troubleshoot this properly. Once I click OK on the message box, I can just
press F5 and the macro runs perfectly, but I would rather not have this
annoying step. Where should I look for the problem