Re: macros do not work the same on different computers

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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?



.



Relevant Pages

  • Re: Determine Deleted Text
    ... Collection) that fits a number of applications I am ... Jim D. ... >that are touched or included by the selection. ... >starts immediately after a deletion, ...
    (microsoft.public.word.vba.general)
  • Re: Why doesnt the delete key delete in OS X
    ... Still think that comments related to deletion are irrelevant Snit? ... "Highlight a file in finder. ... You changed the topic to text selection. ...
    (comp.sys.mac.advocacy)
  • Re: WHEN-ELSE vs CASE statement
    ... as that will generate a mux instead of a long priority selection chain. ... requires overlapping cases. ... Synthesis is not free to create priority logic based on a keyword alone. ... The if statement with zero or one else clauses. ...
    (comp.lang.vhdl)
  • Re: 1.9 patch computer question
    ... This is the affinity selection in task manager. ... Some games don't like running on multiple CPU's. ... > The games priority is just that, ... DVD burn. ...
    (alt.games.warcraft)
  • Re: OT: Was Barbara Bush ever a blonde?
    ... Nice selection of "Most Important Priority" Making sure the stock market rises? ... Fighting for 2nd Amendment rights? ...
    (alt.marketing.online.ebay)