I have a file with four buttons to refresh specific queries in PQ in a certain order after certain things are accomplished each day. My original file works just fine. However when I save a copy with a new name, keeps the original name with the date on the end, the new file gives me an error saying the file is corrupt and to recover it.
This is what I see when the repair happens
Removed Part: /xl/vbaProject.bin part. (Visual Basic for Applications (VBA))
Repaired Records: Cell information from /xl/worksheets/sheet1.xml part
Repaired Records: Cell information from /xl/worksheets/sheet2.xml part
Repaired Records: Cell information from /xl/worksheets/sheet5.xml part
Repaired Records: Cell information from /xl/worksheets/sheet6.xml part
Repaired Records: Cell information from /xl/worksheets/sheet9.xml part
Repaired Records: Cell information from /xl/worksheets/sheet10.xml part
Below is an example of the code. Three buttons are exactly like this. the following code is the one that is slightly different.
Private Sub RefreshALL_Click()
Application.ScreenUpdating = False
ThisWorkbook.Connections("Query - Clerk Cheat Sheet").Refresh
ThisWorkbook.Connections("Query - Freight Report").Refresh
ThisWorkbook.Connections("Query - qry_bol_hdr_cans").Refresh
Application.ScreenUpdating = True
End Sub
Private Sub RefreshPSG_Click()
Application.ScreenUpdating = False
Range("B2") = Date
Range("tblRoutes[LOAD]").Select
Selection.ClearContents
Range("AD7:AF32").Select
Selection.ClearContents
Range("AD35:AF36").Select
Selection.ClearContents
Range("AF34").Select
Selection.ClearContents
ThisWorkbook.Connections("Query - qryPSG_detail").Refresh
ThisWorkbook.Connections("Query - tblRTKData").Refresh
Application.ScreenUpdating = True
End Sub
Currently I can save my historical file as an XLSX but I would like to be able to just save it to keep it simple for anyone coming in after me.
This is what I see when the repair happens
Removed Part: /xl/vbaProject.bin part. (Visual Basic for Applications (VBA))
Repaired Records: Cell information from /xl/worksheets/sheet1.xml part
Repaired Records: Cell information from /xl/worksheets/sheet2.xml part
Repaired Records: Cell information from /xl/worksheets/sheet5.xml part
Repaired Records: Cell information from /xl/worksheets/sheet6.xml part
Repaired Records: Cell information from /xl/worksheets/sheet9.xml part
Repaired Records: Cell information from /xl/worksheets/sheet10.xml part
Below is an example of the code. Three buttons are exactly like this. the following code is the one that is slightly different.
Private Sub RefreshALL_Click()
Application.ScreenUpdating = False
ThisWorkbook.Connections("Query - Clerk Cheat Sheet").Refresh
ThisWorkbook.Connections("Query - Freight Report").Refresh
ThisWorkbook.Connections("Query - qry_bol_hdr_cans").Refresh
Application.ScreenUpdating = True
End Sub
Private Sub RefreshPSG_Click()
Application.ScreenUpdating = False
Range("B2") = Date
Range("tblRoutes[LOAD]").Select
Selection.ClearContents
Range("AD7:AF32").Select
Selection.ClearContents
Range("AD35:AF36").Select
Selection.ClearContents
Range("AF34").Select
Selection.ClearContents
ThisWorkbook.Connections("Query - qryPSG_detail").Refresh
ThisWorkbook.Connections("Query - tblRTKData").Refresh
Application.ScreenUpdating = True
End Sub
Currently I can save my historical file as an XLSX but I would like to be able to just save it to keep it simple for anyone coming in after me.