PDA

View Full Version : Compile Error with Word Private Sub



tunes10590
01-02-2015, 08:04 AM
Hello,

I usually do most of my macro work in Excel, but had the need to write a Word macro, so I am probably missing something easy. I created a word doc with some control text fields. I found some code online to force currency formatting in several of the boxes.


Private Sub TextBox1_LostFocus()
With Me.TextBox1
If Not IsNumeric(.Value) Then
.Value = vbNullString
Else
.Text = Format(.Value, "$#,##0.00")
End If
End With
End Sub


It works like a charm for me, but when I send it to a co-worker, she gets an error message stating

Compile Error:
Object library invalid or contains references to object definitions that could not be found.

Any thoughts as to what is going on. We are both using Word 2013, by the way.

Thank you!

Paul_Hossler
01-05-2015, 10:34 AM
In the VBE on her machine, check Tools, References and see if any are #Missing