Runtime Error 6028

Discussion in 'Word VBA Beginners' started by Tim Flohrschutz, Apr 13, 2012.

  1. 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.
     
    Tim Flohrschutz, Apr 13, 2012
    #1
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Meera

    Runtime Error 5854. String Parameter is too long

    Meera, Nov 26, 2003, in forum: Word VBA Beginners
    Replies:
    2
    Views:
    1,165
    Guest
    Nov 28, 2003
  2. Paul_

    Runtime error 4605 - command not available

    Paul_, May 7, 2004, in forum: Word VBA Beginners
    Replies:
    1
    Views:
    507
    Word Heretic
    May 13, 2004
  3. Razz
    Replies:
    4
    Views:
    154
  4. Jezebel

    Re: Runtime error 5825 Object has been deleted?

    Jezebel, Sep 3, 2006, in forum: Word VBA Beginners
    Replies:
    0
    Views:
    775
    Jezebel
    Sep 3, 2006
  5. Joacim

    Re: Runtime error 5825 Object has been deleted?

    Joacim, Sep 3, 2006, in forum: Word VBA Beginners
    Replies:
    18
    Views:
    480
    Joacim
    Sep 3, 2006
  6. Runtime Error 5843

    , Mar 7, 2007, in forum: Word VBA Beginners
    Replies:
    2
    Views:
    286
    R-ESQR
    Mar 7, 2007
  7. steve
    Replies:
    2
    Views:
    1,978
    steve
    Nov 15, 2007
  8. Christopher Koeber

    6028 "The Range cannot be deleted"

    Christopher Koeber, Jan 17, 2008, in forum: Word VBA Beginners
    Replies:
    1
    Views:
    546
    Julian
    Jan 17, 2008
Loading...