+ Reply to Thread
Results 1 to 3 of 3

On Error Resume Next not working

  1. #1
    Registered User
    Join Date
    08-29-2018
    Location
    Barnsley
    MS-Off Ver
    Office 2013
    Posts
    4

    On Error Resume Next not working

    I have the following snippet of my code where the On Error Resume Next is not working if the user inadvertently copies an image into the clipboard.

    I just get the error message: Run-time error '-2147221404 (80040064)': DataObject:GetText Invalid FORMATETC structure

    I just need to be able to skip the error but can't seem to find an answer if anyone can help please.

    Dim dataObj As MSForms.DataObject
    Dim strPaste As string

    Set dataObj = New MSForms.DataObject
    dataObj.GetFromClipboard

    On Error Resume Next
    strPaste = dataObj.GetText
    Last edited by pcsparky; 06-19-2019 at 07:12 AM.

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: On Error Resume Next not working

    is that the only "On Error" statement?

    I tried it on my end with just the code you posted, and I only get the error message if I comment out the On Error Resume Next statement. When I leave it in, it just continues without errors.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: On Error Resume Next not working

    Why not test to see if they've copied text to the clipboard?
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

+ 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. Runtime Error 53 On error resume next not working
    By KevBotes in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-01-2016, 11:07 AM
  2. On Error Resume Next not working on some PC's
    By Bishonen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-29-2015, 12:05 PM
  3. [SOLVED] VBA help needed to capture Error and Remove Pivot if error exist else resume
    By Tescatlipoca in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-18-2014, 05:46 PM
  4. [SOLVED] Need Resume and ErrorHandler added to working code
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-06-2013, 10:02 PM
  5. [SOLVED] resume next not working
    By foxguy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-11-2012, 12:50 PM
  6. Resume Next not working
    By foxguy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-17-2010, 11:26 AM
  7. "on error resume next" NOT working...
    By Chris M in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-13-2005, 06:05 PM

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