Sub filename_cellvalue()
Dim SourceWB As Workbook
Dim NewWB As Workbook
Dim strPath As String
Dim FileName As String
With Application
.DisplayAlerts = False
.ScreenUpdating = False
End With
Set SourceWB = ActiveWorkbook
With SourceWB
.Save
FileName = .Sheets("Short").Range("O6").Value
If Dir(.Path & "\Backup", vbDirectory) = vbNullString Then MkDir .Path & "\Backup"
strPath = .Path & "\Backup\"
.SaveCopyAs (strPath & FileName & ".xlsb")
End With
Workbooks.Open (strPath & FileName & ".xlsb")
Set NewWB = ActiveWorkbook
With NewWB
For sh = 1 To Sheets.Count
Sheets(sh).Visible = -1
Next sh
Application.DisplayAlerts = False
Sheets(Array("Consolidated Report", "Welcome")).Select
Sheets("Consolidated Report").Activate
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True
Sheets("New Style").Select
ActiveSheet.Shapes.Range(Array("ColorA3")).Select
Selection.Delete
ActiveSheet.Shapes.Range(Array("ColorA3")).Select
Selection.Delete
Sheets("Garment Detail").Select
ActiveSheet.Shapes.Range(Array("ColorA3")).Select
Selection.Delete
ActiveSheet.Shapes.Range(Array("ColorA3")).Select
Selection.Delete
Sheets("Picture").Select
ActiveSheet.Shapes.Range(Array("ColorA3")).Select
Selection.Delete
ActiveSheet.Shapes.Range(Array("ColorA3")).Select
Selection.Delete
Sheets("Operations").Select
ActiveSheet.Shapes.Range(Array("ColorA3")).Select
Selection.Delete
ActiveSheet.Shapes.Range(Array("ColorA3")).Select
Selection.Delete
Sheets("Machines Data").Select
ActiveSheet.Shapes.Range(Array("ColorA3")).Select
Selection.Delete
ActiveSheet.Shapes.Range(Array("ColorA3")).Select
Selection.Delete
Sheets("Layout").Select
ActiveSheet.Shapes.Range(Array("ColorA3")).Select
Selection.Delete
ActiveSheet.Shapes.Range(Array("ColorA3")).Select
Selection.Delete
Sheets("Report").Select
ActiveSheet.Shapes.Range(Array("ColorA3")).Select
Selection.Delete
ActiveSheet.Shapes.Range(Array("ColorA3")).Select
Selection.Delete
Sheets("Summary").Select
ActiveSheet.Shapes.Range(Array("ColorA3")).Select
Selection.Delete
ActiveSheet.Shapes.Range(Array("Button 554")).Select
Selection.Delete
ActiveSheet.Shapes.Range(Array("Button 556")).Select
Selection.Delete
ActiveSheet.Shapes.Range(Array("Button 553")).Select
Selection.Delete
ActiveSheet.Shapes.Range(Array("Button 627")).Select
Selection.Delete
ActiveSheet.Shapes.Range(Array("Button 555")).Select
Selection.Delete
Sheets("Short").Select
ActiveWindow.SelectedSheets.Visible = False
End With
NewWB.Close SaveChanges:=True
With Application
.DisplayAlerts = True
.ScreenUpdating = True
End With
'Dim Path As String
'Dim FileName As String
'Application.DisplayAlerts = False
'
' If Dir(ThisWorkbook.Path & "\Backup", vbDirectory) = vbNullString Then MkDir ThisWorkbook.Path & "\Backup"
'Path = ThisWorkbook.Path & "\Backup" & "\"
'
'FileName = Range("O6")
'ActiveWorkbook.SaveAs FileName:=Path & FileName & ".xlsb", FileFormat:=50
'Application.DisplayAlerts = False
'
'
'ChDir "C:\Users\ltpurc08\Desktop\Thread Consumption Software"
'Workbooks.Open FileName:= _
'"C:\Users\ltpurc08\Desktop\Thread Consumption Software\Thread Consumption.xlsb"
'Windows("Thread Consumption.xlsb").Activate
'ActiveWindow.ActivateNext
'
'ActiveWorkbook.Close
End Sub