Hello All. I am new to Excel Forum and VBA. I managed to create an Excel 2010 macro enabled user form and via VBA code saves the form as a normal Excel Worksheet (xlsx) with a new file name. My problem is that when the new file is opened it is still linked. I figured out how to manually break the link and disable macro notice but this is after the new file has been created, and would have to be done manually for every file saved. Is there a VBA code I can add that will do this before saving the new file.
This is the code I am using to save the new file:
[code]
Sub SaveInvWithNewName()
Dim NewFN As Variant
' Copy Invoice to a new workbook
ActiveSheet.Shapes.Range(Array("Bevel 2")).Delete
ActiveSheet.Shapes.Range(Array("Bevel 3")).Delete
ActiveSheet.Copy
NewFN = "C:\XXXXX\" & Range("I4").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
NextInvoice
End Sub
[code]
Bookmarks