C
cphenley
I would like to save a file with multiple sheets while retaining th
current values and format, but not the links so I can minimize fil
storage space and load time.
I wrote an add in that creates a new sheet. Is is possible to modif
this to save in a file format without links, or is there another way
can approach this?
Thanks in advance for any input.
Sub SelectNewFile()
Dim MyFileName As String, Fdate As String, NewName As String, awb A
Workbook, BackupFileName As String, i As Integer, OK As Boolean
If TypeName(ActiveWorkbook) = "Nothing" Then Exit Sub
Set awb = ActiveWorkbook
If awb.Path = "" Then
Application.Dialogs(xlDialogSaveAs).Show
Else
BackupFileName = awb.Name
OK = False
On Error GoTo NotAbleToSave
If Dir("I:\Pyro-Process reports\SIC-2\" & BackupFileName
<> "" Then
Kill "I:\Pyro-Process reports\SIC-2\" & BackupFileName
End If
With awb
Application.StatusBar = "Saving this workbook..."
.Save
Application.StatusBar = "Saving this workboo
backup..."
.SaveCopyAs "I:\Pyro-Process reports\SIC-2\"
BackupFileName
OK = True
End With
End If
NotAbleToSave:
Set awb = Nothing
Application.StatusBar = False
If Range("B4").Value = "" Then
Range("B4").Value = InputBox("Please enter the new date"
"Date")
Else
Range("B4").Value = Range("B4").Value + 1
End If
Range("B4").NumberFormat = "mm-dd-yy;@"
Fdate = Format(Range("B4"), "mm_dd_yy")
MyFileName = "SIC_2_" & Fdate & ".xls"
ActiveWorkbook.SaveAs "I:\Pyro-Process reports\SIC-2\" & MyFileNam
' Save as new file using date
Calculate
' Refresh data
End Su
current values and format, but not the links so I can minimize fil
storage space and load time.
I wrote an add in that creates a new sheet. Is is possible to modif
this to save in a file format without links, or is there another way
can approach this?
Thanks in advance for any input.
Sub SelectNewFile()
Dim MyFileName As String, Fdate As String, NewName As String, awb A
Workbook, BackupFileName As String, i As Integer, OK As Boolean
If TypeName(ActiveWorkbook) = "Nothing" Then Exit Sub
Set awb = ActiveWorkbook
If awb.Path = "" Then
Application.Dialogs(xlDialogSaveAs).Show
Else
BackupFileName = awb.Name
OK = False
On Error GoTo NotAbleToSave
If Dir("I:\Pyro-Process reports\SIC-2\" & BackupFileName
<> "" Then
Kill "I:\Pyro-Process reports\SIC-2\" & BackupFileName
End If
With awb
Application.StatusBar = "Saving this workbook..."
.Save
Application.StatusBar = "Saving this workboo
backup..."
.SaveCopyAs "I:\Pyro-Process reports\SIC-2\"
BackupFileName
OK = True
End With
End If
NotAbleToSave:
Set awb = Nothing
Application.StatusBar = False
If Range("B4").Value = "" Then
Range("B4").Value = InputBox("Please enter the new date"
"Date")
Else
Range("B4").Value = Range("B4").Value + 1
End If
Range("B4").NumberFormat = "mm-dd-yy;@"
Fdate = Format(Range("B4"), "mm_dd_yy")
MyFileName = "SIC_2_" & Fdate & ".xls"
ActiveWorkbook.SaveAs "I:\Pyro-Process reports\SIC-2\" & MyFileNam
' Save as new file using date
Calculate
' Refresh data
End Su