+ Reply to Thread
Results 1 to 13 of 13

Error code 4605 which seems random in appearance - Excel 2010

  1. #1
    Registered User
    Join Date
    12-19-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    14

    Error code 4605 which seems random in appearance - Excel 2010

    I have a macro which uses a data from an excel file and auto populates a Word document (template). The macro copies text from certain cells and pastes them in the Word document at bookmark locations. However, some times Error code 4605 'This method or property is not available because the Clipboard is empty or not valid'. It almost seems random in where the error appears in the code. In addition I am having trouble with the Word app staying 'live' when the macro runs into an error and I cant seem to close it. This may have something to do we me using objWord and not appWord. But when I substitute objWord for appWord in the code below, it cant seem to find the bookmarks.
    Any help with why the error is showing and how to fix it and then how to fix this terminating appWord issue.

    Please Login or Register  to view this content.

    Thanks

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Error code 4605 which seems random in appearance - Excel 2010

    You might try sprinkling the DoEvents statement throughout your code. This releases resources to allow other applications to process their own queues and sometimes helps in situations like this.

  3. #3
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Error code 4605 which seems random in appearance - Excel 2010

    Hi -

    You can avoid copy and paste like;
    Please Login or Register  to view this content.
    event

  4. #4
    Registered User
    Join Date
    12-19-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Error code 4605 which seems random in appearance - Excel 2010

    event,

    Your method certainly looks neater, however I get Run-time error '438': Object doesn't support this property or method. Any suggestions?

    Storm85

  5. #5
    Registered User
    Join Date
    12-19-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Error code 4605 which seems random in appearance - Excel 2010

    mrice,
    I shamelessly inserted half a dozen DoEvents, not really knowing how to use them properly (I assumed you simply put DoEvents interspersed with sections of code), but to no avail.... Same error immediately following a DoEvent.

    Storm85

  6. #6
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Error code 4605 which seems random in appearance - Excel 2010

    Hi -

    Please post the codes where you get error '438'

    event

  7. #7
    Registered User
    Join Date
    12-19-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Error code 4605 which seems random in appearance - Excel 2010

    Here you go:
    Please Login or Register  to view this content.
    Errors on the first .Bookmarks line.

  8. #8
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Error code 4605 which seems random in appearance - Excel 2010

    Hi -

    Post the word document as well.

    event

  9. #9
    Registered User
    Join Date
    12-19-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Error code 4605 which seems random in appearance - Excel 2010

    event,

    Sanitised document attached - thanks of the help.

    Storm85
    Attached Files Attached Files

  10. #10
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Error code 4605 which seems random in appearance - Excel 2010

    Hi -

    this works for me;
    Please Login or Register  to view this content.
    event

  11. #11
    Registered User
    Join Date
    12-19-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Error code 4605 which seems random in appearance - Excel 2010

    Event,

    It works a treat - no more error! Thank you for your time and expertise!

    Storm85

  12. #12
    Registered User
    Join Date
    12-19-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Error code 4605 which seems random in appearance - Excel 2010

    Event,

    It works a treat - no more error! Thank you for your time and expertise!

    Storm85

  13. #13
    Registered User
    Join Date
    01-13-2014
    Location
    Dallas, Texas, USA
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Error code 4605 which seems random in appearance - Excel 2010

    Application.CutCopyMode = False
    to clear your clipboard

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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