PEngCs
PEngCs

Reputation: 23

Good VBA script fails to run on other computer

I have a very complex excel macro workbook. The VBA code seems to run pretty well on PC's at my location. As soon as I send it to a German colleague it fails to run in unexpected locations of the code.
The last problem I came across is a Runtime error 5 when the code try to modify the Caption of a UserForm (and some text boxes and cmd buttons as well).
Previously we faced with the same issue with SlicerCache(x).ClearManualFilter but somehow I healed itself...

My first thought was to break up the nest With and see which row causes the fail, but it's immediately the first row. I assume it'll do the same for all rows.
I have checked the windows and office settings:

Public Sub verExport()
   With zurueckExport
        .Caption = "Version Exportieren zum Creo"
        .Label1.Caption = "Welche Version möchten Sie zum Creo exportieren?"
        .CommandButtonExportieren.Visible = True
        .CommandButtonZurueckladen.Visible = False
        .CommandButtonKennlinie.Visible = False
        .KennlinieFormat.Visible = False
        .Show
   End With
End Sub

Upvotes: 0

Views: 221

Answers (1)

PEngCs
PEngCs

Reputation: 23

The captions were too long, that generated the error message on the other computer.

Resolution:
I have added several different labels to the UserForm and modify their visibility instead of overwrite the caption.

Many thanks for @J0eBl4ck for the idea.

Upvotes: 1

Related Questions