Hello everyone:
Thanks to everyone for helping me in my last post.
I have some VBA code which I have started using in Excel 2007 which is used to save 2 open workbooks (which have the date as part of their filenames) and close the files, then close Excel itself. The code is as follows:
Sub CloseFiles()
With Worksheets("Raw Data")
.Range("A398:A" & Rows.Count).EntireRow.ClearContents
End With
Sheets("Raw Data").Select
Range("A1").Select
wbname = ThisWorkbook.Name
wbfnlname = Left(wbname, Len(wbname) - 11) & "-D CAN I" & ".xlsm"
Workbooks(wbfnlname).Close savechanges:=True
With ActiveWorkbook
.Save
End With
Application.Quit
End Sub
Sometimes when I run the code, I get a message from Excel asking me if I wish to save a file with a weird filename such as "F2E60000", with no extension, yet Explorer shows it to have the exact same size as the other files which I am saving down to the byte. If I do not save the file, then the data in the files in the above code are not saved.
Previously, the code ran in Excel 2003 without a hitch. What is going on?