FUNCTIONAL PORTION: The code below saves 2 tabs from an xlsm file to a new xlsx file. the file stays open for editing.
ERROR: The xlsm tab has a trigger in the sheet code. That trigger is invalid and causes an error as soon as anything is entered in the xlsx sheet.
DESIRED OUTPUT: no error generated when editing the new file
FAILED FIX ATTEMPT: I tried to use Scripting to delete the macros but the brand new sheet doesn't give access to its code. I might have done that wrong...
Sub seedPro()
Dim wb As Workbook
Set wb = ActiveWorkbook
Dim wb2 As Workbook ' for new workbook
' make new sheet/names
Worksheets(Array("Pro Focus", "AF-LU")).Copy
Set wb2 = ActiveWorkbook
wb2.SaveAs Filename:="New Form.xlsx", FileFormat:=xlOpenXMLWorkbook
End Sub
Below is the sheet macro that triggers on editing the new xlsx Saved in Pro Focus tab
Private Sub Worksheet_Change(ByVal target As Range)
If target.Address = "$C$2" And Not target.Value = "Company" Then
newProspect "focus" ' causes error because this is not found in the xlsx
End If
End Sub