ReneY
02-18-2009, 05:41 AM
Hi everyone
I'm writing a code for a program that compiles information from different excel files into another excel file and renames it; that works fine, the problem I have is that when you open this new file that was created with the macro, all the code is saved in it too (as it just "renames and saves" itself).
The code that I use for renaming the file is:
" ActiveWorkbook.SaveAs Filename:= _"Compilation.xls" "
How can I do to have a "clean" file without the code, or at least not running the "Workbook_Open" sub? (Because it hides all the sheets and pops out the user form)
I'm sure creating a subroutine will be the solution, I just have no idea how to command it to "stop" or "deactivate" the macro from keep running.
Cheers
ReneY
I'm writing a code for a program that compiles information from different excel files into another excel file and renames it; that works fine, the problem I have is that when you open this new file that was created with the macro, all the code is saved in it too (as it just "renames and saves" itself).
The code that I use for renaming the file is:
" ActiveWorkbook.SaveAs Filename:= _"Compilation.xls" "
How can I do to have a "clean" file without the code, or at least not running the "Workbook_Open" sub? (Because it hides all the sheets and pops out the user form)
I'm sure creating a subroutine will be the solution, I just have no idea how to command it to "stop" or "deactivate" the macro from keep running.
Cheers
ReneY