#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 88
Default close w/o saving

i have the following macro in a macro enabled template (xl 2007):

ActiveSheet.Name = Range("B1").Value & " (PO# " & Range("B5").Value
& " Error Sheet.xlsx" ' (this just renames it so i can use it as the subject
line)
ActiveWorkbook.SendMail ",
Subject:=ActiveSheet.Name '(works right up to here)
ActiveWorkbook.Close
ActiveWorkbook.SaveChanges = False (i do not want to save any changes
made to the template - just close it.)

any suggestions on how to close the template without saving the information
that was entered?

thank you,

jat



the last two lines need some manipulation but i cannot find the right two
lines.



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default close w/o saving

Before the close line:

Application.Display Alerts = False

After the Close line:

Application.Display Alerts = True


HTH,
Paul

--

"jatman" wrote in message
...
i have the following macro in a macro enabled template (xl 2007):

ActiveSheet.Name = Range("B1").Value & " (PO# " & Range("B5").Value
& " Error Sheet.xlsx" ' (this just renames it so i can use it as the
subject
line)
ActiveWorkbook.SendMail ",
Subject:=ActiveSheet.Name '(works right up to here)
ActiveWorkbook.Close
ActiveWorkbook.SaveChanges = False (i do not want to save any changes
made to the template - just close it.)

any suggestions on how to close the template without saving the
information
that was entered?

thank you,

jat



the last two lines need some manipulation but i cannot find the right two
lines.





  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 88
Default close w/o saving

i get a run-time error, 483 - object doesn't support this property or method.
when i hit debeg, it highlights the first application.display alerts = false
line.

thank you though,

jat


"PCLIVE" wrote:

Before the close line:

Application.Display Alerts = False

After the Close line:

Application.Display Alerts = True


HTH,
Paul

--

"jatman" wrote in message
...
i have the following macro in a macro enabled template (xl 2007):

ActiveSheet.Name = Range("B1").Value & " (PO# " & Range("B5").Value
& " Error Sheet.xlsx" ' (this just renames it so i can use it as the
subject
line)
ActiveWorkbook.SendMail ",
Subject:=ActiveSheet.Name '(works right up to here)
ActiveWorkbook.Close
ActiveWorkbook.SaveChanges = False (i do not want to save any changes
made to the template - just close it.)

any suggestions on how to close the template without saving the
information
that was entered?

thank you,

jat



the last two lines need some manipulation but i cannot find the right two
lines.






  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,389
Default close w/o saving

Remove the space between 'display' and 'alerts'.

Regards,
Fred.

"jatman" wrote in message
...
i get a run-time error, 483 - object doesn't support this property or
method.
when i hit debeg, it highlights the first application.display alerts =
false
line.

thank you though,

jat


"PCLIVE" wrote:

Before the close line:

Application.Display Alerts = False

After the Close line:

Application.Display Alerts = True


HTH,
Paul

--

"jatman" wrote in message
...
i have the following macro in a macro enabled template (xl 2007):

ActiveSheet.Name = Range("B1").Value & " (PO# " &
Range("B5").Value
& " Error Sheet.xlsx" ' (this just renames it so i can use it as the
subject
line)
ActiveWorkbook.SendMail ",
Subject:=ActiveSheet.Name '(works right up to here)
ActiveWorkbook.Close
ActiveWorkbook.SaveChanges = False (i do not want to save any
changes
made to the template - just close it.)

any suggestions on how to close the template without saving the
information
that was entered?

thank you,

jat



the last two lines need some manipulation but i cannot find the right
two
lines.







  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default close w/o saving

First of all, displayalerts has no space.

Secondly, that won't prevent saving. You must fake Excel into thinking the
workbook is already saved.

With ActiveWorkbook
.Saved = True
.Close
End With


Gord Dibben MS Excel MVP

On Thu, 28 Feb 2008 15:22:00 -0800, jatman
wrote:

i get a run-time error, 483 - object doesn't support this property or method.
when i hit debeg, it highlights the first application.display alerts = false
line.

thank you though,

jat


"PCLIVE" wrote:

Before the close line:

Application.Display Alerts = False

After the Close line:

Application.Display Alerts = True


HTH,
Paul

--

"jatman" wrote in message
...
i have the following macro in a macro enabled template (xl 2007):

ActiveSheet.Name = Range("B1").Value & " (PO# " & Range("B5").Value
& " Error Sheet.xlsx" ' (this just renames it so i can use it as the
subject
line)
ActiveWorkbook.SendMail ",
Subject:=ActiveSheet.Name '(works right up to here)
ActiveWorkbook.Close
ActiveWorkbook.SaveChanges = False (i do not want to save any changes
made to the template - just close it.)

any suggestions on how to close the template without saving the
information
that was entered?

thank you,

jat



the last two lines need some manipulation but i cannot find the right two
lines.









  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default close w/o saving

Sorry about the typo. Remove the space as others have mentioned.

Before the close line:

Application.DisplayAlerts = False

After the Close line:

Application.DisplayAlerts = True


--

"jatman" wrote in message
...
i get a run-time error, 483 - object doesn't support this property or
method.
when i hit debeg, it highlights the first application.display alerts =
false
line.

thank you though,

jat


"PCLIVE" wrote:

Before the close line:

Application.Display Alerts = False

After the Close line:

Application.Display Alerts = True


HTH,
Paul

--

"jatman" wrote in message
...
i have the following macro in a macro enabled template (xl 2007):

ActiveSheet.Name = Range("B1").Value & " (PO# " &
Range("B5").Value
& " Error Sheet.xlsx" ' (this just renames it so i can use it as the
subject
line)
ActiveWorkbook.SendMail ",
Subject:=ActiveSheet.Name '(works right up to here)
ActiveWorkbook.Close
ActiveWorkbook.SaveChanges = False (i do not want to save any
changes
made to the template - just close it.)

any suggestions on how to close the template without saving the
information
that was entered?

thank you,

jat



the last two lines need some manipulation but i cannot find the right
two
lines.








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to Prompt User to Close After Saving Rutabaga Excel Discussion (Misc queries) 2 July 12th 07 12:38 AM
VBA - Close without saving changes PaulW Excel Discussion (Misc queries) 2 July 27th 06 01:22 PM
Am i the first person to close and excel file, without saving chan Cjbrad Excel Discussion (Misc queries) 3 March 2nd 06 07:58 PM
Excel 2003: File->Close without saving changes (save menu does no. Wai-Yee Excel Discussion (Misc queries) 5 July 25th 05 11:49 PM
Excel shoud not close all active books when clicking close button technomike Excel Discussion (Misc queries) 0 June 10th 05 05:35 PM


All times are GMT +1. The time now is 04:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"