Code needed to close w/out saving

  • Thread starter Thread starter GorillaBoze
  • Start date Start date
G

GorillaBoze

I have a macro that saves one worksheet as formated text, then I woul
like it to close the workbook without saving. The code is...

Sheets("Output").Select
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Janece.OCI\My Documents\M
Import-OCI (Copy).prn", _
FileFormat:=xlTextPrinter, CreateBackup:=False
Application.DisplayAlerts = True
ActiveWorkbook.Close , Savechanges = False

I am still promted if I would like to save the changes?? An
suggestions?

-Cha
 
This line is not correct

ActiveWorkbook.Close , Savechanges = False

Must be

ActiveWorkbook.Close Savechanges = False
 
-----Original Message-----
I have a macro that saves one worksheet as formated text, then I would
like it to close the workbook without saving. The code is...

Sheets("Output").Select
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Janece.OCI\My Documents\MF
Import-OCI (Copy).prn", _
FileFormat:=xlTextPrinter, CreateBackup:=False
Application.DisplayAlerts = True
ActiveWorkbook.Close , Savechanges = False

I am still promted if I would like to save the changes?? Any
suggestions?

-Chad


---
Message posted

.
Application.DisplayAlerts=True
If this is changed to "False" it may close without
prompting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top