Re: macros do not work the same on different computers
- From: Courtney <Courtney@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 5 Dec 2007 10:14:01 -0800
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?
- Follow-Ups:
- Re: macros do not work the same on different computers
- From: Jay Freedman
- Re: macros do not work the same on different computers
- References:
- 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: Save Autotext entry to User.dot
- Next by Date: Spellchecking against a hidden Word object
- 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
|