I have a workbook with 2 sheets (with macros) and I'd like to save the workbook as it to a specific location without macros...
This is what I have but the file being saved is not copying as excel.
Sub makecopy()
Dim FileSaveAsName As String
'~~> Change to relevant Path
FileSaveAsName = "L:AAA ShareAMR - Kaiser2012Kaiser OH#43.xls" & Format(Now, "yyyy-mm-dd")
On Error GoTo ErrH:
If Dir(FileSaveAsName) <> "" Then Kill FileSaveAsName
ActiveWorkbook.SaveAs Filename:=FileSaveAsName
Exit Sub
ErrH:
MsgBox FileSaveAsName & " is either readonly or open. You cannot save the file with that name."
End Sub
Sub DelMod()
Dim vbCom As Object
Set vbCom = Application.VBE.ActiveVBProject.VBComponents
vbCom.Remove VBComponent:= _
vbCom.Item("Module1")
vbCom.Item ("thisworkbook")
End Sub
thank you so much in advance....
This is what I have but the file being saved is not copying as excel.
Sub makecopy()
Dim FileSaveAsName As String
'~~> Change to relevant Path
FileSaveAsName = "L:AAA ShareAMR - Kaiser2012Kaiser OH#43.xls" & Format(Now, "yyyy-mm-dd")
On Error GoTo ErrH:
If Dir(FileSaveAsName) <> "" Then Kill FileSaveAsName
ActiveWorkbook.SaveAs Filename:=FileSaveAsName
Exit Sub
ErrH:
MsgBox FileSaveAsName & " is either readonly or open. You cannot save the file with that name."
End Sub
Sub DelMod()
Dim vbCom As Object
Set vbCom = Application.VBE.ActiveVBProject.VBComponents
vbCom.Remove VBComponent:= _
vbCom.Item("Module1")
vbCom.Item ("thisworkbook")
End Sub
thank you so much in advance....