D
Dee Veloper
Why doesn't this line of code work:
ActiveWorkbook.Close savechanges = False
nor does this one:
Databook.Close savechanges = False
in both cases above the file gets saved even though it shouldn't
but this one works
DataBook.Close False
all variables are declared
code excerpt:
For i = 1 To 10
Workbooks.Open .Files(i)
Set DataBook = ActiveWorkbook
For Each ws In ActiveWorkbook.Worksheets
ws.Activate
MonthStamp
Range("data").Copy
NewWkBook.Activate
ActiveSheet.Paste
Next
DataBook.Activate
Application.DisplayAlerts = False
DataBook.Close False 'this works
'ActiveWorkbook.Close savechanges = False doesn't work
NewWkBook.Activate
Next i
ActiveWorkbook.Close savechanges = False
nor does this one:
Databook.Close savechanges = False
in both cases above the file gets saved even though it shouldn't
but this one works
DataBook.Close False
all variables are declared
code excerpt:
For i = 1 To 10
Workbooks.Open .Files(i)
Set DataBook = ActiveWorkbook
For Each ws In ActiveWorkbook.Worksheets
ws.Activate
MonthStamp
Range("data").Copy
NewWkBook.Activate
ActiveSheet.Paste
Next
DataBook.Activate
Application.DisplayAlerts = False
DataBook.Close False 'this works
'ActiveWorkbook.Close savechanges = False doesn't work
NewWkBook.Activate
Next i