stevemyers
Board Regular
- Joined
- Apr 25, 2014
- Messages
- 62
I have the following code below. I need to correct the following issues:
1. I have a button that activates the code and I would like to button to disappear on the saved sheet.
2. There is no reason to save this as a macro enabled sheet.
3. When the saved sheet is re-saved it asks if the link should be updated..it should NOT and I don't want the user to be asked the question (eliminate the dialog box and choice)....maybe this will automatically happen when it is not saved as macro enabled?
Sub savesheet()
Const sPath As String = "\\AESBS\Company Shared Folders\!Quality System Records\NCMRs\2014\"
Sheet1.Copy
With ActiveWorkbook
.SaveAs Filename:=sPath & "NCM-" & Range("M2").Value & ".xlsm", _
FileFormat:=xlOpenXMLWorkbookMacroEnabled
.Close
End With
Sheets("F_020").Select
ActiveWindow.SelectedSheets.PrintOut copies:=1, collate:=True, _
IgnorePrintAreas:=False
Sheets("F_020").Select
ActiveWorkbook.Close
End Sub
1. I have a button that activates the code and I would like to button to disappear on the saved sheet.
2. There is no reason to save this as a macro enabled sheet.
3. When the saved sheet is re-saved it asks if the link should be updated..it should NOT and I don't want the user to be asked the question (eliminate the dialog box and choice)....maybe this will automatically happen when it is not saved as macro enabled?
Sub savesheet()
Const sPath As String = "\\AESBS\Company Shared Folders\!Quality System Records\NCMRs\2014\"
Sheet1.Copy
With ActiveWorkbook
.SaveAs Filename:=sPath & "NCM-" & Range("M2").Value & ".xlsm", _
FileFormat:=xlOpenXMLWorkbookMacroEnabled
.Close
End With
Sheets("F_020").Select
ActiveWindow.SelectedSheets.PrintOut copies:=1, collate:=True, _
IgnorePrintAreas:=False
Sheets("F_020").Select
ActiveWorkbook.Close
End Sub