+ Reply to Thread
Results 1 to 6 of 6

Excel 2010 Not able to run my Macro

  1. #1
    Registered User
    Join Date
    03-13-2012
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Excel 2010 Not able to run my Macro

    We have a number of Macros that were built using Excel 2003 (and ran fine) that are now not able to run using Excel 2010. I'm guessing it is some type of syntax issue, but I haven't been able to find anything specific to this issue online, so that's why I'm here.

    I am receiving the following error on the "Selection.Entirerow.Insert" line:

    "Run-time error '1004': The information cannot be pasted because the Copy area and the paste area are not the same size and shape."

    Essentially we are copying rows from one spreadsheet to another based on certain criteria.

    Please Login or Register  to view this content.
    Any help is much appreciated!

    Doug Walker
    Last edited by DWalker10; 03-13-2012 at 05:33 PM.

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Excel 2010 Not able to run my Macro

    Maybe try this revised version (not tested):

    Please Login or Register  to view this content.
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    03-13-2012
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Excel 2010 Not able to run my Macro

    "Run-time error '438': Object doesn't support this property or method"

    on this line:

    Please Login or Register  to view this content.

  4. #4
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Excel 2010 Not able to run my Macro

    Knew I was going to have to test it.

    Shortened (working version):

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-13-2012
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Excel 2010 Not able to run my Macro

    Works like a charm. Much appreciated. A few questions in response if you don't mind.

    Care to explain why my previous code broke? Was it just a syntax change through the versions as I wondered?

    Also, I did add in one line to the If statement within the For.

    Please Login or Register  to view this content.
    We have a large amount of data, and otherwise the user receives a message asking them to clear the clipboard.

    Thanks Again!
    Last edited by DWalker10; 03-13-2012 at 05:27 PM. Reason: Including more information

  6. #6
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Excel 2010 Not able to run my Macro

    I don't really know that I have not used Excel 03 for a while now, and even then I wasn't using vba. It might be that this line:

    Please Login or Register  to view this content.
    was trying to add more lines that the worksheet has. In my adjusted code, I just pasted instead of inserting lines.

    Also instead of looping through all the rows in the sheet, I limited it to only the first cells that have information in Column B.

    Hope this helps.

    Good luck.

    abousetta

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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