Runtime Error 6028

T

Tim Flohrschutz

I'm adding a UserForm to a Word template. Upon submitting the form, I receive 'Runtime Error 6028 - The range cannot be deleted'. The debugger points to the following script:

Private Sub CmdSubmit_Click()
Application.ScreenUpdating = False
With ActiveDocument
--> .Bookmarks("Text1").Range.Text = txtUserName.Value
.Bookmarks("Text2").Range.Text = txtTest1.Value
.Bookmarks("Text3").Range.Text = txtTest2.Value
.Bookmarks("Text4").Range.Text = txtTest1.Value
End With
Application.ScreenUpdating = True
Unload Me
End Sub

This is a simple test form I have created before I begin working on the real document. On occassion, there will be values that are displayed in multiple places, hence the repition of txtTest1.

I am new to VB coding and any assistance would be greatly appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top