Re: macros do not work the same on different computers
- From: Courtney <Courtney@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 5 Dec 2007 12:14:00 -0800
I think the macros are being run because when my coworkers are opening the
form, Microsoft asks them if they want to enable macros. They are clicking
enable, so I think it is running. I will use your method to check tomorrow,
as my coworkers have already left for the day. Thank you so much for your
help.
"Jay Freedman" wrote:
Can you tell for sure whether the macro is running at all? Is it possible.
that what the other users are seeing is just the default that appears when
the macro doesn't run?
To test, modify the macro so the first executable line after the Sub
ColorCheck() line is a message box, something like
MsgBox "Executing ColorCheck"
When you use the form on your computer, you'll see this message box before
the values change, and it'll wait for you to click OK. Now mail the form to
someone else. Do they also see the message? If not, then the macro isn't
being run. As I said before, the most likely cause is that the macro is in a
template that the recipients don't have.
Courtney wrote:
No one is getting any error messages. On my computer, the cascaded
drop-down box values change when I change the selection of the
top-level box (i.e.Color). When my coworkers use the form, it only
shows the values for one of the top-level selections (Red), no matter
which selection they choose in the top-level drop-down box. I am
including my code for the macro below:
Sub ColorCheck()
'
' ColorCheck Macro
' Macro created 11/19/2007 by courtney.lake
' If ActiveDocument.FormFields("Color").DropDown.Value = 0 Then
'
ActiveDocument.FormFields("Change").DropDown.ListEntries.Clear '
Exit Sub ' End If
Select Case ActiveDocument.FormFields("Color").Result
Case " "
With
ActiveDocument.FormFields("Change").DropDown.ListEntries
.Clear End With Case " "
With
ActiveDocument.FormFields("Change").DropDown.ListEntries
.Clear End With Case "Brown"
With
ActiveDocument.FormFields("Change").DropDown.ListEntries
.Clear .Add "Addition, Deletion, or Priority" .Add "Other
(Provide description in Comments section below)" End With
Case "Green" With
ActiveDocument.FormFields("Change").DropDown.ListEntries
.Clear .Add "Addition, Deletion, or Priority" .Add "Other
(Provide description in Comments section below)" End With
Case "Black" With
ActiveDocument.FormFields("Change").DropDown.ListEntries
.Clear .Add "Addition, Deletion, or Priority" .Add "Other
(Provide description in Comments section below)" End With
Case "Yellow" With
ActiveDocument.FormFields("Change").DropDown.ListEntries
.Clear .Add "Addition, Deletion, or Priority" .Add "Other
(Provide description in Comments section below)" End With
Case "Blue" With
ActiveDocument.FormFields("Change").DropDown.ListEntries
.Clear .Add "Addition, Deletion, or Priority" .Add "Other
(Provide description in Comments section below)" End With
Case "Red" With
ActiveDocument.FormFields("Change").DropDown.ListEntries
.Clear .Add "Addition, Deletion, or Priority" .Add
"Multiplication" .Add "Other (Provide description in
Comments section below)" End With Case "Purple" With
ActiveDocument.FormFields("Change").DropDown.ListEntries
.Clear .Add "Addition, Deletion, or Priority" .Add
"Multiplication" .Add "Other (Provide description in Comments section
below)" End With End Select
Select Case ActiveDocument.FormFields("Color").Result
Case " "
With
ActiveDocument.FormFields("Version").DropDown.ListEntries
.Clear End With Case "Brown"
With
ActiveDocument.FormFields("Version").DropDown.ListEntries
.Clear .Add "Brown Version 1.0.0" .Add "Other (Provide
description in Comments section below)" End With Case
"Green" With
ActiveDocument.FormFields("Version").DropDown.ListEntries
.Clear .Add "Green Version 2.0.0" .Add "Other (Provide
description in Comments section below)" End With Case
"Black" With
ActiveDocument.FormFields("Version").DropDown.ListEntries
.Clear .Add "Other (Provide description in Comments section
below)" End With Case "Blue" With
ActiveDocument.FormFields("Version").DropDown.ListEntries
.Clear .Add "Blue Version 3.0.0" .Add "Other (Provide
description in Comments section below)" End With Case
"Red" With
ActiveDocument.FormFields("Version").DropDown.ListEntries
.Clear .Add "Red Version 4.0.0" .Add "Other (Provide
description in Comments section below)" End With Case
"Purple" With
ActiveDocument.FormFields("Version").DropDown.ListEntries
.Clear .Add "Purple Version 1.0.0" .Add "Other (Provide
description in Comments section below)" End With Case
"Yellow" With
ActiveDocument.FormFields("Version").DropDown.ListEntries
.Clear .Add "Other (Provide description in Comments section
below)" End With End Select
End Sub
"Jay Freedman" wrote:
What do you mean by "do not perform correctly"? Do they work at all?
If so, what's the difference in their behavior?
Are there any error messages? If so, _exactly_ what do they say?
Does the VBA editor open with a line highlighted? If so, post the
code and indicate which line was highlighted.
If they don't work at all, the cause is probably that the code is in
a template that you aren't mailing to others, and when the form
document is mailed it loses access to the code. When the form is
sent back to you, of course you have the template, so the code runs.
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
Courtney wrote:
I created a form with macros for cascading drop-down boxes. The
form works perfectly on my PC, but if I email it to my coworkers,
the macros do not perform correctly. I have had them email the
form back to me to make sure the file did not get corrupted in the
email process and it still worked as designed on my PC. We are
running the same operating system, the same version of MS Word, and
when I checked the VB version (via opening the VB from Word and
clicking Help->About) the version was the same. Does anyone know
what could possibly be causing this?
- References:
- Re: macros do not work the same on different computers
- From: Jay Freedman
- Re: macros do not work the same on different computers
- From: Courtney
- Re: macros do not work the same on different computers
- From: Jay Freedman
- Re: macros do not work the same on different computers
- Prev by Date: Re: Nest If Statements in REF Field
- Next by Date: Re: Making 2 Tables into 1 Table
- Previous by thread: Re: macros do not work the same on different computers
- Next by thread: Re: macros do not work the same on different computers
- Index(es):
Relevant Pages
|