View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default how do I prevent a workbook from being saved?

Maybe you could set its Saved property to true, and close it


Set this = ActiveWorkbook
Cells.Copy
Workbooks.Add
ActiveSheet.Paste
Sheets("Sheet1").Name = "Investment Quotation"
this.Saved = True
this.Close

--

HTH

RP
(remove nothere from the email address if mailing direct)


"crimsonkng" wrote in message
...
At a certain point in my macro, the User can make a decision to create a

new
workbook (called "Investment Quotation" as shown below). A small portion

of
the macro is shown, below. At that point, the macro performs a
copy-and-paste from the current workbook to a new workbook. When that
happens, I need to prevent the original (first) workbook from being saved.

(I
won't know the name of the first workbook.)

The problem is that I want the User to have the right to save/change the
original workbook. It's just that I'm trying to prevent them from saving

the
original workbook ONLY if they decide to create a new workbook.

So, I guess my question is: how do I tell Excel to "don't allow a save" to
the first workbook? (Again, the User is allowed to save the file BEFORE
this part of the macro is executed.)

Cells.Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "Investment Quotation"