ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   disable macro during save-as (https://www.excelbanter.com/excel-programming/388583-disable-macro-during-save.html)

excelnut1954

disable macro during save-as
 
I have a macro in ThisWorkbook in a workbook named Template, that will
make sure a column is cleared before the user starts. This, in case
someone saves data in this workbook by accident.

The user will run other macros, and eventually a macro will save this
workbook under a new name based on the date, example NewFile 1-1-07 .
However, if the user brings up this workbook NewFile 1-1-07 again
later, this column will be wiped out via the ThisWorkbook coding.

What I want is to include code within the macros that will disable the
code in ThisWorkbook so that column is not wiped out when it is opened
later.

Thanks,
J.O.


Mike

disable macro during save-as
 
I dont think you can disable the code when doing a save as What uo could do
instead of save as is to copy to a new book so that the code will not follow
the
workbook. Add or Subract sheets that you need

Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select
Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Copy

"excelnut1954" wrote:

I have a macro in ThisWorkbook in a workbook named Template, that will
make sure a column is cleared before the user starts. This, in case
someone saves data in this workbook by accident.

The user will run other macros, and eventually a macro will save this
workbook under a new name based on the date, example NewFile 1-1-07 .
However, if the user brings up this workbook NewFile 1-1-07 again
later, this column will be wiped out via the ThisWorkbook coding.

What I want is to include code within the macros that will disable the
code in ThisWorkbook so that column is not wiped out when it is opened
later.

Thanks,
J.O.



excelnut1954

disable macro during save-as
 
On May 2, 11:45 am, Mike wrote:
I dont think you can disable the code when doing a save as What uo could do
instead of save as is to copy to a new book so that the code will not follow
the
workbook. Add or Subract sheets that you need

Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select
Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Copy



"excelnut1954" wrote:
I have a macro in ThisWorkbook in a workbook named Template, that will
make sure a column is cleared before the user starts. This, in case
someone saves data in this workbook by accident.


The user will run other macros, and eventually a macro will save this
workbook under a new name based on the date, example NewFile 1-1-07 .
However, if the user brings up this workbook NewFile 1-1-07 again
later, this column will be wiped out via the ThisWorkbook coding.


What I want is to include code within the macros that will disable the
code in ThisWorkbook so that column is not wiped out when it is opened
later.


Thanks,
J.O.- Hide quoted text -


- Show quoted text -


Thanks Mike
I wasn't sure if you could have a macro write to a macro, especially
since I have the VB window password protected.
I'll try your method.
If someone else has an idea, I would appreciate it.
Thanks again for your suggestion, Mike.
J.O.



All times are GMT +1. The time now is 05:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com