+ Reply to Thread
Results 1 to 4 of 4

Repeat error - VBA Automation (Help Needed)

  1. #1
    Registered User
    Join Date
    02-01-2017
    Location
    Leeds
    MS-Off Ver
    2010
    Posts
    12

    Post Repeat error - VBA Automation (Help Needed)

    Hello,

    Firstly, thank you for taking the time to read my thead!

    With the help of one of the forum members here I was able to produce a piece of VBA coding which automatically copied data from excel into word.

    The code function works fine, however I keep receiving errors (Different errors on different lines).

    The errors aren't the same, and from what I have been able to work out can happen at any time, on any cell. The code however some times runs all the way through with no errors, without me changing anything on either documents.

    I have attached both documents & coding below. I was hoping someone could download & run a few times to see if they can make sense of the issue.

    *The word document needs to be open whilst running the macro
    *Please run a few times before coming to the conclusion it is fixed.
    *Document A is the excel document the data needs to be copied from.
    *Document B is the word document I require the data to be transferred to.


    Logic - I require the code to copy and paste data into word headings, which I have set up already within word.

    I initially thought this may be due to the clipboard being full, as the error is appearing sporadically.... So I added in
    Please Login or Register  to view this content.
    which then allowed me to complete the module, however on the second run the same errors started to appear.

    Please Login or Register  to view this content.
    Any help would be greatly appreciated.

    Thanks,
    Michael
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    02-01-2017
    Location
    Leeds
    MS-Off Ver
    2010
    Posts
    12

    Re: Repeat error - VBA Automation (Help Needed)

    Update - The run time error I seem to be receiving, irregardless of which line of data it decides to appear on in "4605"

  3. #3
    Valued Forum Contributor
    Join Date
    03-24-2014
    Location
    England
    MS-Off Ver
    Excel 2003 - 2016
    Posts
    575

    Re: Repeat error - VBA Automation (Help Needed)

    In word go to File>Options>General and see if there is a check mark in the box:

    "Open e-mail attachments and other uneditable files in reading view"

    If there is, remove it.

    *From answers.microsoft.com

  4. #4
    Registered User
    Join Date
    02-01-2017
    Location
    Leeds
    MS-Off Ver
    2010
    Posts
    12

    Re: Repeat error - VBA Automation (Help Needed)

    I have just checked, the box was already set as unmarked.

    I have done some research & amended my code slightly to clear the clipboard after every paste as run time error 4605 seems to be associated with clipboard issues.

    I created a macro to clear clipboard labelled "Empty Clipboard" and then referenced it after every pasted.

    This seems to have increased the success rate to 3/5 times.

    Code now amended to:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Loop Nesting is returning Run-Time Error '-2147221080 (800401a8)': Automation Error
    By ChristopherBrandonKi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-21-2014, 02:36 PM
  2. Copy / Paste / Save As - Automation Help Needed
    By polyzp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-19-2014, 12:27 PM
  3. Copy / Paste / Save As - Automation Help Needed
    By polyzp in forum Excel General
    Replies: 2
    Last Post: 09-18-2014, 06:55 PM
  4. help needed on Putty automation using Excel VB application
    By mohanece in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-17-2014, 04:27 AM
  5. [SOLVED] Run-tim error -2147467259(80004005): Automation error Unspecidied error
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-25-2014, 12:12 PM
  6. Automation Error help needed
    By funkymonkUK in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-23-2006, 09:46 AM
  7. Automation Error ... Urgent help needed
    By Alexander.Kom in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-14-2005, 05:58 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1