+ Reply to Thread
Results 1 to 3 of 3

error: Code Execution has been interrupted

  1. #1
    Joshua Fredrickson
    Guest

    error: Code Execution has been interrupted

    User gets an error "Code Execution has been interrupted" when trying to run
    a Macro from her personal.xls

    She just got a new machine and that is when it stopped working. She copied
    the personal.xls from her older machine with same OS and Office version to
    the new machine.

    I checked the references and nothing says missing and very few things are
    checked.

    The code looks fine to me and works from other machines.

    I did a detect and repair on office with no luck. I changed the unc paths
    for first few workbook opens which prevented errors on those files but then
    it gives us the error on the line that activates the first open file.

    Here is the macro which I've attached in text format.

    Any help would be greatly appreciated. I've done some searches on the
    internet and tried technet but was unable to find anything that fixed the
    problem.

    Thanks,

    Joshua





  2. #2
    Joshua Fredrickson
    Guest

    Re: error: Code Execution has been interrupted

    Some may be reluctant to open a .txt file for some reason so here is macro:

    Sub XfmrRept()
    '
    ' XfmrRept Macro
    ' Macro recorded 12/17/2001 by C20656
    '
    ' Keyboard Shortcut: Ctrl+t
    '
    ChDir "G:\EXCEL50\Xfmrrept"
    Workbooks.Open Filename:= _
    "\\DS5\SYS2\STORES\GROUP\EXCEL50\Xfmrrept\kuhlman.xls"
    Workbooks.Open
    Filename:="\\DS5\SYS2\STORES\GROUP\EXCEL50\Xfmrrept\ermco.xls"
    Workbooks.Open Filename:= _
    "\\DS5\SYS2\STORES\GROUP\EXCEL50\Xfmrrept\xfmrall.xls"
    Windows("ermco.xls").Activate
    Sheets("Transformer Issues and Transfer").Select
    Sheets("Transformer Issues and Transfer").Copy
    Before:=Workbooks("xfmrall.xls").Sheets(1)
    Windows("kuhlman.xls").Activate
    Sheets("Transformer Issues and Transfer").Select
    Sheets("Transformer Issues and Transfer").Copy
    Before:=Workbooks("xfmrall.xls").Sheets(1)
    Windows("ermco.xls").Activate
    ActiveWindow.Close
    Windows("kuhlman.xls").Activate
    ActiveWindow.Close
    ActiveWindow.TabRatio = 0.568
    Sheets("Transformer Issues and Tran (3)").Select
    Sheets("Transformer Issues and Tran (3)").Name = "Issues &
    Transfers-Kuhlman"
    Sheets("Transformer Issues and Tran (2)").Select
    Sheets("Transformer Issues and Tran (2)").Name = "Issues &
    Transfers-ERMCO"
    Sheets("Transformer Issues and Transfer").Select
    Sheets("Transformer Issues and Transfer").Name = "Issues & Transfers-All
    Xfmrs"
    Sheets("Issues & Transfers-Kuhlman").Select
    Workbooks.Open Filename:= _
    "\\DS5\SYS2\STORES\GROUP\EXCEL50\Xfmrrept\xfmr010205.xls"
    Rows("1:4").Select
    Selection.Copy
    Application.CutCopyMode = False
    Sheets(Array("Issues & Transfers-Kuhlman", "Issues & Transfers-ERMCO", _
    "Issues & Transfers-All Xfmrs")).Select
    Sheets("Issues & Transfers-Kuhlman").Activate
    Rows("1:4").Select
    Selection.Copy
    Windows("xfmrall.xls").Activate
    Sheets(Array("Issues & Transfers-Kuhlman", "Issues & Transfers-ERMCO", _
    "Issues & Transfers-All Xfmrs")).Select
    Sheets("Issues & Transfers-Kuhlman").Activate
    Rows("1:1").Select
    Selection.Insert Shift:=xlDown
    Rows("5:5").Select
    Application.CutCopyMode = False
    Selection.Delete Shift:=xlUp
    Rows("5:40").Select
    Selection.RowHeight = 15
    Range("A5").Select
    Sheets(Array("Issues & Transfers-Kuhlman", "Issues & Transfers-ERMCO", _
    "Issues & Transfers-All Xfmrs")).Select
    Sheets("Issues & Transfers-Kuhlman").Activate
    With ActiveSheet.PageSetup
    .LeftHeader = ""
    .CenterHeader = ""
    .RightHeader = ""
    .LeftFooter = ""
    .CenterFooter = ""
    .RightFooter = ""
    .LeftMargin = Application.InchesToPoints(0.5)
    .RightMargin = Application.InchesToPoints(0.5)
    .TopMargin = Application.InchesToPoints(1)
    .BottomMargin = Application.InchesToPoints(1)
    .HeaderMargin = Application.InchesToPoints(0.5)
    .FooterMargin = Application.InchesToPoints(0.5)
    .PrintHeadings = False
    .PrintGridlines = False
    .PrintComments = xlPrintNoComments
    .CenterHorizontally = False
    .CenterVertically = False
    .Orientation = xlLandscape
    .Draft = False
    .PaperSize = xlPaperLetter
    .FirstPageNumber = xlAutomatic
    .Order = xlDownThenOver
    .BlackAndWhite = False
    .Zoom = 100
    End With
    With ActiveSheet.PageSetup
    .LeftHeader = ""
    .CenterHeader = ""
    .RightHeader = ""
    .LeftFooter = ""
    .CenterFooter = ""
    .RightFooter = ""
    .LeftMargin = Application.InchesToPoints(0.5)
    .RightMargin = Application.InchesToPoints(0.5)
    .TopMargin = Application.InchesToPoints(1)
    .BottomMargin = Application.InchesToPoints(1)
    .HeaderMargin = Application.InchesToPoints(0.5)
    .FooterMargin = Application.InchesToPoints(0.5)
    .PrintHeadings = False
    .PrintGridlines = False
    .PrintComments = xlPrintNoComments
    .CenterHorizontally = True
    .CenterVertically = False
    .Orientation = xlLandscape
    .Draft = False
    .PaperSize = xlPaperLetter
    .FirstPageNumber = xlAutomatic
    .Order = xlDownThenOver
    .BlackAndWhite = False
    .Zoom = 100
    End With
    With ActiveSheet.PageSetup
    .LeftHeader = ""
    .CenterHeader = ""
    .RightHeader = ""
    .LeftFooter = ""
    .CenterFooter = ""
    .RightFooter = ""
    .LeftMargin = Application.InchesToPoints(0.5)
    .RightMargin = Application.InchesToPoints(0.5)
    .TopMargin = Application.InchesToPoints(1)
    .BottomMargin = Application.InchesToPoints(1)
    .HeaderMargin = Application.InchesToPoints(0.5)
    .FooterMargin = Application.InchesToPoints(0.5)
    .PrintHeadings = False
    .PrintGridlines = False
    .PrintComments = xlPrintNoComments
    .CenterHorizontally = True
    .CenterVertically = False
    .Orientation = xlLandscape
    .Draft = False
    .PaperSize = xlPaperLetter
    .FirstPageNumber = xlAutomatic
    .Order = xlDownThenOver
    .BlackAndWhite = False
    .Zoom = 100
    End With
    With ActiveSheet.PageSetup
    .LeftHeader = ""
    .CenterHeader = ""
    .RightHeader = ""
    .LeftFooter = ""
    .CenterFooter = ""
    .RightFooter = ""
    .LeftMargin = Application.InchesToPoints(0.5)
    .RightMargin = Application.InchesToPoints(0.5)
    .TopMargin = Application.InchesToPoints(1)
    .BottomMargin = Application.InchesToPoints(1)
    .HeaderMargin = Application.InchesToPoints(0.5)
    .FooterMargin = Application.InchesToPoints(0.5)
    .PrintHeadings = False
    .PrintGridlines = False
    .PrintComments = xlPrintNoComments
    .CenterHorizontally = True
    .CenterVertically = False
    .Orientation = xlLandscape
    .Draft = False
    .PaperSize = xlPaperLetter
    .FirstPageNumber = xlAutomatic
    .Order = xlDownThenOver
    .BlackAndWhite = False
    .Zoom = 100
    End With
    Sheets("Issues & Transfers-All Xfmrs").Select
    With ActiveSheet.PageSetup
    .PrintTitleRows = "$4:$4"
    .PrintTitleColumns = ""
    End With
    ActiveSheet.PageSetup.PrintArea = ""
    With ActiveSheet.PageSetup
    .LeftHeader = ""
    .CenterHeader = ""
    .RightHeader = ""
    .LeftFooter = ""
    .CenterFooter = ""
    .RightFooter = ""
    .LeftMargin = Application.InchesToPoints(0.5)
    .RightMargin = Application.InchesToPoints(0.5)
    .TopMargin = Application.InchesToPoints(1)
    .BottomMargin = Application.InchesToPoints(1)
    .HeaderMargin = Application.InchesToPoints(0.5)
    .FooterMargin = Application.InchesToPoints(0.5)
    .PrintHeadings = False
    .PrintGridlines = False
    .PrintComments = xlPrintNoComments
    .CenterHorizontally = True
    .CenterVertically = False
    .Orientation = xlLandscape
    .Draft = False
    .PaperSize = xlPaperLetter
    .FirstPageNumber = xlAutomatic
    .Order = xlDownThenOver
    .BlackAndWhite = False
    .Zoom = 100
    End With
    Sheets("Issues & Transfers-ERMCO").Select
    With ActiveSheet.PageSetup
    .PrintTitleRows = "$4:$4"
    .PrintTitleColumns = ""
    End With
    ActiveSheet.PageSetup.PrintArea = ""
    With ActiveSheet.PageSetup
    .LeftHeader = ""
    .CenterHeader = ""
    .RightHeader = ""
    .LeftFooter = ""
    .CenterFooter = ""
    .RightFooter = ""
    .LeftMargin = Application.InchesToPoints(0.5)
    .RightMargin = Application.InchesToPoints(0.5)
    .TopMargin = Application.InchesToPoints(1)
    .BottomMargin = Application.InchesToPoints(1)
    .HeaderMargin = Application.InchesToPoints(0.5)
    .FooterMargin = Application.InchesToPoints(0.5)
    .PrintHeadings = False
    .PrintGridlines = False
    .PrintComments = xlPrintNoComments
    .CenterHorizontally = True
    .CenterVertically = False
    .Orientation = xlLandscape
    .Draft = False
    .PaperSize = xlPaperLetter
    .FirstPageNumber = xlAutomatic
    .Order = xlDownThenOver
    .BlackAndWhite = False
    .Zoom = 100
    End With
    Sheets("Issues & Transfers-Kuhlman").Select
    With ActiveSheet.PageSetup
    .PrintTitleRows = "$4:$4"
    .PrintTitleColumns = ""
    End With
    ActiveSheet.PageSetup.PrintArea = ""
    With ActiveSheet.PageSetup
    .LeftHeader = ""
    .CenterHeader = ""
    .RightHeader = ""
    .LeftFooter = ""
    .CenterFooter = ""
    .RightFooter = ""
    .LeftMargin = Application.InchesToPoints(0.5)
    .RightMargin = Application.InchesToPoints(0.5)
    .TopMargin = Application.InchesToPoints(1)
    .BottomMargin = Application.InchesToPoints(1)
    .HeaderMargin = Application.InchesToPoints(0.5)
    .FooterMargin = Application.InchesToPoints(0.5)
    .PrintHeadings = False
    .PrintGridlines = False
    .PrintComments = xlPrintNoComments
    .CenterHorizontally = True
    .CenterVertically = False
    .Orientation = xlLandscape
    .Draft = False
    .PaperSize = xlPaperLetter
    .FirstPageNumber = xlAutomatic
    .Order = xlDownThenOver
    .BlackAndWhite = False
    .Zoom = 100
    End With
    Windows("xfmr010205").Activate
    ActiveWindow.Close
    End Sub



  3. #3
    Joshua Fredrickson
    Guest

    Re: error: Code Execution has been interrupted

    Any ideas?

    Thanks again and sorry if two days is to early to bump this thread.

    Joshua

    "Joshua Fredrickson" <[email protected]> wrote in message
    news:[email protected]...
    > Some may be reluctant to open a .txt file for some reason so here is

    macro:
    >
    > Sub XfmrRept()
    > '
    > ' XfmrRept Macro
    > ' Macro recorded 12/17/2001 by C20656
    > '
    > ' Keyboard Shortcut: Ctrl+t
    > '
    > ChDir "G:\EXCEL50\Xfmrrept"
    > Workbooks.Open Filename:= _
    > "\\DS5\SYS2\STORES\GROUP\EXCEL50\Xfmrrept\kuhlman.xls"
    > Workbooks.Open
    > Filename:="\\DS5\SYS2\STORES\GROUP\EXCEL50\Xfmrrept\ermco.xls"
    > Workbooks.Open Filename:= _
    > "\\DS5\SYS2\STORES\GROUP\EXCEL50\Xfmrrept\xfmrall.xls"
    > Windows("ermco.xls").Activate
    > Sheets("Transformer Issues and Transfer").Select
    > Sheets("Transformer Issues and Transfer").Copy
    > Before:=Workbooks("xfmrall.xls").Sheets(1)
    > Windows("kuhlman.xls").Activate
    > Sheets("Transformer Issues and Transfer").Select
    > Sheets("Transformer Issues and Transfer").Copy
    > Before:=Workbooks("xfmrall.xls").Sheets(1)
    > Windows("ermco.xls").Activate
    > ActiveWindow.Close
    > Windows("kuhlman.xls").Activate
    > ActiveWindow.Close
    > ActiveWindow.TabRatio = 0.568
    > Sheets("Transformer Issues and Tran (3)").Select
    > Sheets("Transformer Issues and Tran (3)").Name = "Issues &
    > Transfers-Kuhlman"
    > Sheets("Transformer Issues and Tran (2)").Select
    > Sheets("Transformer Issues and Tran (2)").Name = "Issues &
    > Transfers-ERMCO"
    > Sheets("Transformer Issues and Transfer").Select
    > Sheets("Transformer Issues and Transfer").Name = "Issues &

    Transfers-All
    > Xfmrs"
    > Sheets("Issues & Transfers-Kuhlman").Select
    > Workbooks.Open Filename:= _
    > "\\DS5\SYS2\STORES\GROUP\EXCEL50\Xfmrrept\xfmr010205.xls"
    > Rows("1:4").Select
    > Selection.Copy
    > Application.CutCopyMode = False
    > Sheets(Array("Issues & Transfers-Kuhlman", "Issues & Transfers-ERMCO",

    _
    > "Issues & Transfers-All Xfmrs")).Select
    > Sheets("Issues & Transfers-Kuhlman").Activate
    > Rows("1:4").Select
    > Selection.Copy
    > Windows("xfmrall.xls").Activate
    > Sheets(Array("Issues & Transfers-Kuhlman", "Issues & Transfers-ERMCO",

    _
    > "Issues & Transfers-All Xfmrs")).Select
    > Sheets("Issues & Transfers-Kuhlman").Activate
    > Rows("1:1").Select
    > Selection.Insert Shift:=xlDown
    > Rows("5:5").Select
    > Application.CutCopyMode = False
    > Selection.Delete Shift:=xlUp
    > Rows("5:40").Select
    > Selection.RowHeight = 15
    > Range("A5").Select
    > Sheets(Array("Issues & Transfers-Kuhlman", "Issues & Transfers-ERMCO",

    _
    > "Issues & Transfers-All Xfmrs")).Select
    > Sheets("Issues & Transfers-Kuhlman").Activate
    > With ActiveSheet.PageSetup
    > .LeftHeader = ""
    > .CenterHeader = ""
    > .RightHeader = ""
    > .LeftFooter = ""
    > .CenterFooter = ""
    > .RightFooter = ""
    > .LeftMargin = Application.InchesToPoints(0.5)
    > .RightMargin = Application.InchesToPoints(0.5)
    > .TopMargin = Application.InchesToPoints(1)
    > .BottomMargin = Application.InchesToPoints(1)
    > .HeaderMargin = Application.InchesToPoints(0.5)
    > .FooterMargin = Application.InchesToPoints(0.5)
    > .PrintHeadings = False
    > .PrintGridlines = False
    > .PrintComments = xlPrintNoComments
    > .CenterHorizontally = False
    > .CenterVertically = False
    > .Orientation = xlLandscape
    > .Draft = False
    > .PaperSize = xlPaperLetter
    > .FirstPageNumber = xlAutomatic
    > .Order = xlDownThenOver
    > .BlackAndWhite = False
    > .Zoom = 100
    > End With
    > With ActiveSheet.PageSetup
    > .LeftHeader = ""
    > .CenterHeader = ""
    > .RightHeader = ""
    > .LeftFooter = ""
    > .CenterFooter = ""
    > .RightFooter = ""
    > .LeftMargin = Application.InchesToPoints(0.5)
    > .RightMargin = Application.InchesToPoints(0.5)
    > .TopMargin = Application.InchesToPoints(1)
    > .BottomMargin = Application.InchesToPoints(1)
    > .HeaderMargin = Application.InchesToPoints(0.5)
    > .FooterMargin = Application.InchesToPoints(0.5)
    > .PrintHeadings = False
    > .PrintGridlines = False
    > .PrintComments = xlPrintNoComments
    > .CenterHorizontally = True
    > .CenterVertically = False
    > .Orientation = xlLandscape
    > .Draft = False
    > .PaperSize = xlPaperLetter
    > .FirstPageNumber = xlAutomatic
    > .Order = xlDownThenOver
    > .BlackAndWhite = False
    > .Zoom = 100
    > End With
    > With ActiveSheet.PageSetup
    > .LeftHeader = ""
    > .CenterHeader = ""
    > .RightHeader = ""
    > .LeftFooter = ""
    > .CenterFooter = ""
    > .RightFooter = ""
    > .LeftMargin = Application.InchesToPoints(0.5)
    > .RightMargin = Application.InchesToPoints(0.5)
    > .TopMargin = Application.InchesToPoints(1)
    > .BottomMargin = Application.InchesToPoints(1)
    > .HeaderMargin = Application.InchesToPoints(0.5)
    > .FooterMargin = Application.InchesToPoints(0.5)
    > .PrintHeadings = False
    > .PrintGridlines = False
    > .PrintComments = xlPrintNoComments
    > .CenterHorizontally = True
    > .CenterVertically = False
    > .Orientation = xlLandscape
    > .Draft = False
    > .PaperSize = xlPaperLetter
    > .FirstPageNumber = xlAutomatic
    > .Order = xlDownThenOver
    > .BlackAndWhite = False
    > .Zoom = 100
    > End With
    > With ActiveSheet.PageSetup
    > .LeftHeader = ""
    > .CenterHeader = ""
    > .RightHeader = ""
    > .LeftFooter = ""
    > .CenterFooter = ""
    > .RightFooter = ""
    > .LeftMargin = Application.InchesToPoints(0.5)
    > .RightMargin = Application.InchesToPoints(0.5)
    > .TopMargin = Application.InchesToPoints(1)
    > .BottomMargin = Application.InchesToPoints(1)
    > .HeaderMargin = Application.InchesToPoints(0.5)
    > .FooterMargin = Application.InchesToPoints(0.5)
    > .PrintHeadings = False
    > .PrintGridlines = False
    > .PrintComments = xlPrintNoComments
    > .CenterHorizontally = True
    > .CenterVertically = False
    > .Orientation = xlLandscape
    > .Draft = False
    > .PaperSize = xlPaperLetter
    > .FirstPageNumber = xlAutomatic
    > .Order = xlDownThenOver
    > .BlackAndWhite = False
    > .Zoom = 100
    > End With
    > Sheets("Issues & Transfers-All Xfmrs").Select
    > With ActiveSheet.PageSetup
    > .PrintTitleRows = "$4:$4"
    > .PrintTitleColumns = ""
    > End With
    > ActiveSheet.PageSetup.PrintArea = ""
    > With ActiveSheet.PageSetup
    > .LeftHeader = ""
    > .CenterHeader = ""
    > .RightHeader = ""
    > .LeftFooter = ""
    > .CenterFooter = ""
    > .RightFooter = ""
    > .LeftMargin = Application.InchesToPoints(0.5)
    > .RightMargin = Application.InchesToPoints(0.5)
    > .TopMargin = Application.InchesToPoints(1)
    > .BottomMargin = Application.InchesToPoints(1)
    > .HeaderMargin = Application.InchesToPoints(0.5)
    > .FooterMargin = Application.InchesToPoints(0.5)
    > .PrintHeadings = False
    > .PrintGridlines = False
    > .PrintComments = xlPrintNoComments
    > .CenterHorizontally = True
    > .CenterVertically = False
    > .Orientation = xlLandscape
    > .Draft = False
    > .PaperSize = xlPaperLetter
    > .FirstPageNumber = xlAutomatic
    > .Order = xlDownThenOver
    > .BlackAndWhite = False
    > .Zoom = 100
    > End With
    > Sheets("Issues & Transfers-ERMCO").Select
    > With ActiveSheet.PageSetup
    > .PrintTitleRows = "$4:$4"
    > .PrintTitleColumns = ""
    > End With
    > ActiveSheet.PageSetup.PrintArea = ""
    > With ActiveSheet.PageSetup
    > .LeftHeader = ""
    > .CenterHeader = ""
    > .RightHeader = ""
    > .LeftFooter = ""
    > .CenterFooter = ""
    > .RightFooter = ""
    > .LeftMargin = Application.InchesToPoints(0.5)
    > .RightMargin = Application.InchesToPoints(0.5)
    > .TopMargin = Application.InchesToPoints(1)
    > .BottomMargin = Application.InchesToPoints(1)
    > .HeaderMargin = Application.InchesToPoints(0.5)
    > .FooterMargin = Application.InchesToPoints(0.5)
    > .PrintHeadings = False
    > .PrintGridlines = False
    > .PrintComments = xlPrintNoComments
    > .CenterHorizontally = True
    > .CenterVertically = False
    > .Orientation = xlLandscape
    > .Draft = False
    > .PaperSize = xlPaperLetter
    > .FirstPageNumber = xlAutomatic
    > .Order = xlDownThenOver
    > .BlackAndWhite = False
    > .Zoom = 100
    > End With
    > Sheets("Issues & Transfers-Kuhlman").Select
    > With ActiveSheet.PageSetup
    > .PrintTitleRows = "$4:$4"
    > .PrintTitleColumns = ""
    > End With
    > ActiveSheet.PageSetup.PrintArea = ""
    > With ActiveSheet.PageSetup
    > .LeftHeader = ""
    > .CenterHeader = ""
    > .RightHeader = ""
    > .LeftFooter = ""
    > .CenterFooter = ""
    > .RightFooter = ""
    > .LeftMargin = Application.InchesToPoints(0.5)
    > .RightMargin = Application.InchesToPoints(0.5)
    > .TopMargin = Application.InchesToPoints(1)
    > .BottomMargin = Application.InchesToPoints(1)
    > .HeaderMargin = Application.InchesToPoints(0.5)
    > .FooterMargin = Application.InchesToPoints(0.5)
    > .PrintHeadings = False
    > .PrintGridlines = False
    > .PrintComments = xlPrintNoComments
    > .CenterHorizontally = True
    > .CenterVertically = False
    > .Orientation = xlLandscape
    > .Draft = False
    > .PaperSize = xlPaperLetter
    > .FirstPageNumber = xlAutomatic
    > .Order = xlDownThenOver
    > .BlackAndWhite = False
    > .Zoom = 100
    > End With
    > Windows("xfmr010205").Activate
    > ActiveWindow.Close
    > End Sub
    >
    >




+ 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