Results 1 to 5 of 5

Thread: "Object variable or with block variable not set" Error on Second loop of For Loop

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,970
    1. Remove the last parts of:
    Set wdDoc = Nothing: Set wdapp = Nothing: Set WkSht = Nothing
    to leave:
    Set wdDoc = Nothing
    or remove that line completely.
    2. Move wdapp.Quit to just before End Sub.

    The code could be a bit more efficient… perhaps more on that later.
    Last edited by p45cal; 10-20-2021 at 08:09 AM.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •