PC Review


Reply
Thread Tools Rate Thread

disable macro during save-as

 
 
excelnut1954
Guest
Posts: n/a
 
      2nd May 2007
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.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlrZQ==?=
Guest
Posts: n/a
 
      2nd May 2007
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.
>
>

 
Reply With Quote
 
excelnut1954
Guest
Posts: n/a
 
      2nd May 2007
On May 2, 11:45 am, Mike <M...@discussions.microsoft.com> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to disable security message in save attachments macro "A programis trying to access e-mail addresses . ." stv.nelson1@gmail.com Microsoft Outlook VBA Programming 5 9th Jun 2009 01:36 PM
Disable print and save through macro Aerojade Microsoft Powerpoint 0 29th Sep 2008 12:19 PM
Disable save, save as, but allow save via command button =?Utf-8?B?VGltTg==?= Microsoft Excel Programming 10 1st Sep 2006 07:05 PM
Disable Save unless a Macro is used LB79 Microsoft Excel Misc 4 23rd Jul 2004 07:32 PM
Disable File-Save menu item in macro? BrianG Microsoft Excel Programming 3 25th Feb 2004 06:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:45 AM.