G
Guest
I have a macro set in 1 workbook that opens a different workbook, copies
information to past into the first workbook then closes the second workbook.
My problem is how do I set the close command to close the second file
without the system message about data on the clipboard - save yes or no?
See code below.
Thank you in advance Dan
Sub Load_Group()
'
GroupNum = Application.InputBox(prompt:=" ENTER A GROUP NUMBER",
Type:=1)
Dim GrpNum As String
GrpNum = GroupNum & ".xls"
ChDir "C:\DATA FILES"
Workbooks.Open Filename:= _
"C:\DATA FILES\Print Out #" & (GrpNum)
Range("A2").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Copy
Windows("Invoice_AND_Total_Sheet.xls").Activate
Range("AH3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Windows("Print Out #" & (GrpNum)).Activate
ActiveWorkbook.Close
Range("A1").Select
Calculate
End Sub
information to past into the first workbook then closes the second workbook.
My problem is how do I set the close command to close the second file
without the system message about data on the clipboard - save yes or no?
See code below.
Thank you in advance Dan
Sub Load_Group()
'
GroupNum = Application.InputBox(prompt:=" ENTER A GROUP NUMBER",
Type:=1)
Dim GrpNum As String
GrpNum = GroupNum & ".xls"
ChDir "C:\DATA FILES"
Workbooks.Open Filename:= _
"C:\DATA FILES\Print Out #" & (GrpNum)
Range("A2").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Copy
Windows("Invoice_AND_Total_Sheet.xls").Activate
Range("AH3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Windows("Print Out #" & (GrpNum)).Activate
ActiveWorkbook.Close
Range("A1").Select
Calculate
End Sub