+ Reply to Thread
Results 1 to 5 of 5

Requesting debugging help

  1. #1
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    452

    Requesting debugging help

    I have this macro,

    Please Login or Register  to view this content.
    and am getting an error at this line, it says,
    Run-time error'4198':
    Method 'PasteAndFormat' of object 'Range' failed
    Please Login or Register  to view this content.
    This line is the 37th line down in the code.
    What is the fix for this?

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Requesting debugging help

    This can't be reproduced without your files. At the point where it fails, what is Rng? What is rngWord? Did the copy happen properly? I suspect that the problem may be in the Copy statement rather than the statement that is raising the error. I think that at the point where your code stops, the clipboard should have your copied content on it and you can try a manual paste into a Word document and see if that works. If it fails it may give you insight as to what's wrong. You could also try inserting a line of code that pastes into Excel instead of Word and see what happens there.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    452

    Re: Requesting debugging help

    I went through your questions and was able to find the error. Thank you.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Requesting debugging help

    Glad to hear it. Care to share what you found?

  5. #5
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    452

    Re: Requesting debugging help

    As far as I can tell, the sheet had been modified but the code hadn't been updated to reflect the modification. It was trying to copy and paste a blank cell, when I changed the cell to be copy and pasted it worked.

+ 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. [SOLVED] Requesting help w/macro issue VBA
    By Jack7774 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-21-2014, 04:32 PM
  2. Requesting help with date function
    By Kitkatlv in forum Excel General
    Replies: 2
    Last Post: 11-05-2012, 10:02 PM
  3. Help In Requesting Data
    By pasteis in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-03-2012, 01:14 PM
  4. Requesting Help with Macro
    By Endlin3 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-08-2010, 06:39 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