Hi all,
I have a weird problem that I stuck with. I have the attached file which copies 4 sheets to another workbook and saves it.
Macro runs smoothly but I'am using this shortened code inside another file and this macro is called inside another macro in that file which causes the problem. When trying to debug step-by-step with F8, I get the weird problem and the code is interrupted, I get the message "Can't execute in break mode error" .
Your help will be highly appreciated.
I have a weird problem that I stuck with. I have the attached file which copies 4 sheets to another workbook and saves it.
Macro runs smoothly but I'am using this shortened code inside another file and this macro is called inside another macro in that file which causes the problem. When trying to debug step-by-step with F8, I get the weird problem and the code is interrupted, I get the message "Can't execute in break mode error" .
Your help will be highly appreciated.
VBA Code:
Sub Byebye2()
'
Dim Aname As String
Dim GetBook As String
Dim YeniBook As String
Dim IslProg As String
On Error Resume Next
IslProg = Application.ActiveWorkbook.Path
GetBook = ActiveWorkbook.Name
Sheets(Array("Cikti1", "Cikti2", "Cikti3", "Cikti4")).Select
Sheets(Array("Cikti1", "Cikti2", "Cikti3", "Cikti4")).Copy
Sheets("Cikti1").Select
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Application.CutCopyMode = False
With ActiveWindow
.ScrollRow = 1
.ScrollColumn = 1
.ActivePane.VisibleRange.Cells(1).Select
End With
Sheets("Cikti2").Select
Cells.Select
Selection.Copy
Cells.Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Application.CutCopyMode = False
With ActiveWindow
.ScrollRow = 1
.ScrollColumn = 1
.ActivePane.VisibleRange.Cells(1).Select
End With
Sheets("Cikti3").Select
Cells.Select
Selection.Copy
Cells.Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Application.CutCopyMode = False
With ActiveWindow
.ScrollRow = 1
.ScrollColumn = 1
.ActivePane.VisibleRange.Cells(1).Select
End With
Sheets("Cikti4").Select
Cells.Select
Selection.Copy
Cells.Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Application.CutCopyMode = False
With ActiveWindow
.ScrollRow = 1
.ScrollColumn = 1
.ActivePane.VisibleRange.Cells(1).Select
End With
YeniBook = ActiveWorkbook.Name
Workbooks(GetBook).Activate
Worksheets("Cikti1").Select
Aname = ActiveWorkbook.Sheets("Cikti1").Range("f33").Value
Workbooks(YeniBook).Activate
Worksheets("Cikti1").Name = "OzetCikti1"
Worksheets("Cikti2").Name = "OzetCikti2"
Worksheets("Cikti3").Name = "OzetCikti3"
Worksheets("Cikti4").Name = "OzetCikti4"
Worksheets("OzetCikti1").Select
YeniBook = ActiveWorkbook.Name
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=IslProg & "\SON_" & Aname, FileFormat:=1, CreateBackup:=False
Application.DisplayAlerts = True
Application.EnableCancelKey = XlEnableCancelKey.xlInterrupt
Application.Calculation = xlAutomatic
Application.ScreenUpdating = True
End Sub