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?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
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,227
    Guest
    Nov 28, 2003
  2. Paul_

    Runtime error 4605 - command not available

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

    Re: Runtime error 5825 Object has been deleted?

    Jezebel, Sep 3, 2006, in forum: Word VBA Beginners
    Replies:
    0
    Views:
    814
    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:
    499
    Joacim
    Sep 3, 2006
  6. Runtime Error 5843

    , Mar 7, 2007, in forum: Word VBA Beginners
    Replies:
    2
    Views:
    302
    R-ESQR
    Mar 7, 2007
  7. steve
    Replies:
    2
    Views:
    2,073
    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:
    568
    Julian
    Jan 17, 2008
Loading...