+ Reply to Thread
Results 1 to 12 of 12

Macro from Excel 2003 not working in 2007

  1. #1
    Registered User
    Join Date
    11-16-2011
    Location
    Prague, Czech Republic
    MS-Off Ver
    Excel 2007
    Posts
    7

    Macro from Excel 2003 not working in 2007

    Hello,

    could you please someone help me with this macro?

    It is working great in Excel 2003, but generated error in 2007: runtime error 1004 paste method of worksheet class failed with highlighted line Activesheet.paste (red marked).

    Please Login or Register  to view this content.
    Any ideas, what can be wrong?

    Konik
    Last edited by pike; 11-16-2011 at 05:01 AM. Reason: add code tags for newbie

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro from Excel 2003 not working in 2007

    What's activerow?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    11-16-2011
    Location
    Prague, Czech Republic
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macro from Excel 2003 not working in 2007

    Hi,

    I would say active row is specified at the beginning, but I am not an author of this macro.

    This macro is just adding 2 text boxes under last active rows + 3 rows.

    Number of rows is always different.
    Last edited by konik; 11-16-2011 at 05:47 AM.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro from Excel 2003 not working in 2007

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  5. #5
    Registered User
    Join Date
    11-16-2011
    Location
    Prague, Czech Republic
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macro from Excel 2003 not working in 2007

    This is good idea. I attached 2 files:

    system output is extraction of our system, then we apply macro test and get result (both in Result in Excel 2003).

    Konik
    Attached Files Attached Files

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro from Excel 2003 not working in 2007

    Using the Result workbook I deleted the boxes then ran the code in Excel 2010 with no problem.

    No error in the other workbook either

  7. #7
    Registered User
    Join Date
    11-16-2011
    Location
    Prague, Czech Republic
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macro from Excel 2003 not working in 2007

    Hi Roy,

    these boxes should be there. I still have hard time to understand, why it can work completely in 2003 and fail in 2007? I found some article on Microsoft help site saying, that there are no major changes between these 2 versions concerning VBA.

    I am still getting errors, see attached pictures.

    Is there any workaround, how to make it work on both versions?
    Attached Images Attached Images
    Last edited by konik; 11-16-2011 at 08:50 AM.

  8. #8
    Registered User
    Join Date
    11-16-2011
    Location
    Prague, Czech Republic
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macro from Excel 2003 not working in 2007

    Better solution how to enter 2 text boxes for signatures under last active row +3 is also welcome.

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro from Excel 2003 not working in 2007

    Why not just merge cells to look like a TextBox?

  10. #10
    Registered User
    Join Date
    11-16-2011
    Location
    Prague, Czech Republic
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macro from Excel 2003 not working in 2007

    Hi Roy,

    this would be OK, but how could I do it, when there is always different number of rows?

  11. #11
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro from Excel 2003 not working in 2007

    Hi konik
    I've taken the liberty of cleaning up the code a bit. It's been tested in both Excel 2000 and Excel 2007. See if this fixes your issue.
    Attached Files Attached Files
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  12. #12
    Registered User
    Join Date
    11-16-2011
    Location
    Prague, Czech Republic
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macro from Excel 2003 not working in 2007

    Attachment 164956 Hi Jaslake,

    I am sorry for very late answer. I tested it at work and it didn't work correctly. First text box is moved up, but second one is correct, see att. picture. What could be wrong? konik

+ 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