question610
New Member
- Joined
- Jul 3, 2017
- Messages
- 29
I am running a macro where I open a workbook, filter that data, copy and paste that data into a new workbook and save the new workbook.
When I am saving the new workbook(through vba), I get this error:
Microsoft Compatibility Checker
"Minor Loss of Fidelity"
Occurrences: 3
Some cells or styles in this workbook contain formatting that is not supported by the selected file format. These formats will be converted to the closest format available.
It says Excel 97-2003.
When I click continue and try to open the saved file, I get this message
"Excel cannot open the file because the file format or file extension is not valid. Verify that the file has not corrupted and that the file extension matches the format of the file"
I am using Excel 2010.
This is my code
When I am saving the new workbook(through vba), I get this error:
Microsoft Compatibility Checker
"Minor Loss of Fidelity"
Occurrences: 3
Some cells or styles in this workbook contain formatting that is not supported by the selected file format. These formats will be converted to the closest format available.
It says Excel 97-2003.
When I click continue and try to open the saved file, I get this message
"Excel cannot open the file because the file format or file extension is not valid. Verify that the file has not corrupted and that the file extension matches the format of the file"
I am using Excel 2010.
This is my code
Code:
curr_date = Format(Now(), "mm-dd")
Customer= Sheets("Info").Cells(i, 3).Value
CustomerID = ("Info ").Cells(i, 1).Value
TheFileName = Customer& " " & "Inventory" & " " & curr_date & ".xlsx"
Selection.AutoFilter Field:=4, Criteria1:=CustomerID
ActiveSheet.AutoFilter.Range.SpecialCells(xlCellTypeVisible).Copy
Workbooks.Add 1
Set NewWbk = ActiveWorkbook
ActiveSheet.Paste
Selection.RowHeight = 15
Selection.Columns.AutoFit
ActiveWorkbook.SaveAs FileName:=Filepath & TheFileName, FileFormat:=xlNormal