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!
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!