Results 1 to 12 of 12

Macro from Excel 2003 not working in 2007

Threaded View

  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).

    Range("A5").Select
        Selection.End(xlDown).Select
        'Range("F252").Select
        activerow = ActiveCell.Row + 3
        Dim position As Double
        position = activerow * 12.75
        position = position + 8.25
        ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 198#, position, _
            313.5, 63.75).Select
        Selection.Characters.Text = "Signature"
        With Selection.Characters(Start:=1, Length:=26).Font
            .Name = "Arial"
            .FontStyle = "Standaard"
            .Size = 10
            .Strikethrough = False
            .Superscript = False
            .Subscript = False
            .OutlineFont = False
            .Shadow = False
            .Underline = xlUnderlineStyleNone
            .ColorIndex = xlAutomatic
        End With
        'Range("F252").Select
        'ActiveSheet.Shapes("Text Box 1").Select
        'Selection.Characters.Text = "Signature"
        'With Selection.Characters(Start:=1, Length:=26).Font
        '    .Name = "Arial"
        '    .FontStyle = "Standaard"
        '    .Size = 10
        '    .Strikethrough = False
        '    .Superscript = False
        '    .Subscript = False
        '    .OutlineFont = False
        '    .Shadow = False
        '    .Underline = xlUnderlineStyleNone
        '    .ColorIndex = xlAutomatic
        'End With
        Selection.Copy
        activeRange = "H" & activerow + 1
        Range(activeRange).Select
        ActiveSheet.Paste
        ActiveWindow.SmallScroll ToRight:=6
        Selection.ShapeRange.IncrementLeft 180#
        Selection.ShapeRange.IncrementTop 0.75
        'ActiveSheet.Shapes("Text Box 2").Select
        Selection.Characters.Text = _
            "Signature"
        With Selection.Characters(Start:=1, Length:=62).Font
            .Name = "Arial"
            .FontStyle = "Standaard"
            .Size = 10
            .Strikethrough = False
            .Superscript = False
            .Subscript = False
            .OutlineFont = False
            .Shadow = False
            .Underline = xlUnderlineStyleNone
            .ColorIndex = xlAutomatic
        End With
        Selection.ShapeRange.ScaleWidth 1.3, msoFalse, msoScaleFromTopLeft
        Range("H139").Select
    Any ideas, what can be wrong?

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

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