ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   error: Code Execution has been interrupted (https://www.excelbanter.com/excel-programming/346186-re-error-code-execution-has-been-interrupted.html)

Joshua Fredrickson

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\Xfmrrep t\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
Befo=Workbooks("xfmrall.xls").Sheets(1)
Windows("kuhlman.xls").Activate
Sheets("Transformer Issues and Transfer").Select
Sheets("Transformer Issues and Transfer").Copy
Befo=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\xfmr0102 05.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



Joshua Fredrickson

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" wrote in message
...
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\Xfmrrep t\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
Befo=Workbooks("xfmrall.xls").Sheets(1)
Windows("kuhlman.xls").Activate
Sheets("Transformer Issues and Transfer").Select
Sheets("Transformer Issues and Transfer").Copy
Befo=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\xfmr0102 05.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






All times are GMT +1. The time now is 06:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com