drj30026abanba
Board Regular
- Joined
- Oct 22, 2015
- Messages
- 83
So I have a bunch of .xls files that are annoying to deal with cause it takes forever to close them. I wrote this code to replace the files as .xlsx files
So this is fine and dandy and all and I can close the workbook freely without that do you want to save dialogue box coming up. The problem is that when I reopen the workbooks, do nothing, and try to exit out of them, it asks me if I want to save again. If I save then it won't happen the next time. Why doesn't Workbooks(i).Saved = True work to cancel this save message the time I try to close it after i reopen it? And how can I fix this?
Thanks!
Code:
Sub xls2xlsx ()
For i = 1 To Workbooks.count
With Workbooks(i)
.SaveAs Filename:=.Path & "\" & .Name & "x", FileFormat:=51
Kill Left(.Path & "\" & .Name, Len(.Path & "\" & .Name) - 1)
.Saved = True
End With
Next i
End Sub
So this is fine and dandy and all and I can close the workbook freely without that do you want to save dialogue box coming up. The problem is that when I reopen the workbooks, do nothing, and try to exit out of them, it asks me if I want to save again. If I save then it won't happen the next time. Why doesn't Workbooks(i).Saved = True work to cancel this save message the time I try to close it after i reopen it? And how can I fix this?
Thanks!