Log in

View Full Version : Code not working and i dont understand the error?



Roofio
10-15-2008, 05:17 PM
Hey

I get an error with the code and line 1 is highlighted in yellow, can someone pls help me fix it and if possible to explain the error? thanks

Private Sub CommandButton1_Click()
Dim Doc As Document
Dim bmCurrent As Bookmark
Dim intPosition As Integer
Dim lngLast As Long
'Initialize globals
intPosition = 1
Set Doc = ActiveDocument
lngLast = Doc.Bookmarks.Count
' Hide and disable update buttons
btnCancelUpdate.Visible = False
btnConfirmUpdate.Visible = False
btnCancelUpdate.Enabled = False
btnConfirmUpdate.Enabled = False
' Common display form rtn
UpdateForm
End Sub



Thank you

CreganTur
10-16-2008, 05:12 AM
What's the exact error message?

fumei
10-20-2008, 12:47 PM
Yes, we need details. Are you saying

Dim Doc As Document

is highlighted as an error? If so, please state what the error message says.

Is Doc declared and Set somewhere else? We do not have enough information.

CreganTur
10-20-2008, 01:12 PM
http://theshadycat.files.wordpress.com/2008/04/johnny5isalive.jpg

More input, more input!