Results 1 to 2 of 2

Updating macro to Excel 2010

Threaded View

  1. #1
    Registered User
    Join Date
    07-11-2009
    Location
    South Gippsland, Australia
    MS-Off Ver
    Excel 2011 (Mac)
    Posts
    31

    Updating macro to Excel 2010

    I have a macro which was developed in Excel 2007 (version 12.0?). When I run it in Excel 2010 (version 14.0), I get some inconsistent errors as follows:

    I have this code operating on one worksheet:

        Range("A1").Select
        ActiveSheet.Paste
    which is acceptable. A little later, I have, operating on a different worksheet:

        Range("A6").Select 
        ActiveSheet.Paste
    which gives a run-time error '1004': Paste method of Worksheet class failed.

    Commenting that statement out and running again. I have this code:

        Cells.Find(What:="3", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
            xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:=False) _
            .Activate
    which runs OK. A few lines further on:

        Cells.Find(What:="6", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
            xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:=False) _
            .Activate
    fails with a run-time error '91': Object variable or width block variable not set.

    What's happening and how do I fix it? These appear to be the only sources of run-time error.

    I'm running the macro in Windows 7 on an ASUS Eee Slate. I can't test it anywhere else.
    Last edited by audax; 05-12-2011 at 12:07 AM.

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