code problem

K

kevin carter

Hi
this is a follow on to a previous thread (Copy Macro)
We are now successfully creating a new Workbook using the code below.

With ActiveWorkbook
FName = .Path & "\code.txt"
.VBProject.VBComponents("Module2_sort").Export FName
End With
ThisWorkbook.Worksheets(Array("Supplier Concerns")).Copy
ActiveWorkbook.SaveAs Filename:="c:\Week\testing" & strFileName &
".xls"
ActiveWorkbook.VBProject.VBComponents.Import FName

Problem is when we open the new Workbook and run the macro the code defaults
back to the original file

Can the code be adapted to run the macro from witin the new WorkBook?


Thanks


Kevin
 
Top