detroitpickles
MIS
I have a routine that save one worksheet in my workbook. What it does actually, is makes a "copy" of a worksheet and opens it in a new "window". It then saves that workbook automatically, getting it's name from a cell in the original workbook. Then it switches the window back to the original and closes the copy.
But, if it is already a file, it won't let me write it. Is there a way to automatically save it on top of what is there, or do I delete the original file first?
Here is what I have (in case anybody wanted it anyway)...
'SAVE Data
Dim OrigWBName As String
Dim OrigWSName As String
OrigWBName = ActiveWorkbook.Name
OrigWSName = ActiveSheet.Name
Worksheets("Package".Activate
ActiveSheet.Copy
'ActiveSheet.Name = "ScorpionDump"
ActiveWorkbook.SaveAs FileName:="C:\Junk\" & txtJobNo.Value & ".xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Windows(OrigWBName).Activate
Windows(txtJobNo.Value & ".xls".Close
Worksheets(OrigWSName).Activate
------------
Mr. Pickles
But, if it is already a file, it won't let me write it. Is there a way to automatically save it on top of what is there, or do I delete the original file first?
Here is what I have (in case anybody wanted it anyway)...
'SAVE Data
Dim OrigWBName As String
Dim OrigWSName As String
OrigWBName = ActiveWorkbook.Name
OrigWSName = ActiveSheet.Name
Worksheets("Package".Activate
ActiveSheet.Copy
'ActiveSheet.Name = "ScorpionDump"
ActiveWorkbook.SaveAs FileName:="C:\Junk\" & txtJobNo.Value & ".xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Windows(OrigWBName).Activate
Windows(txtJobNo.Value & ".xls".Close
Worksheets(OrigWSName).Activate
------------
Mr. Pickles