Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Closing A Spreadsheet

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,59629
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Closing A Spreadsheet
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Closing A Spreadsheet - 4/30/2008 2:31:55 AM   
  sarahbeth27


Posts: 10
Score: 0
Joined: 4/23/2008
From: Houston, Texas
Status: offline
Hello all or anyone, but i am working on a code that all i need now is a wy to close the spread sheet without that alert popping up asking me if i want to save the changes. How do i just close it down without that alert popping up? This is what I have:


ExcelDoc.Close
           
           Set ExcelDoc = Nothing
           Set ExcelData= Nothing
      
  
But as i said i don't want the alert to pop up i just wnt it to close without saving.
Thanks

_____________________________

Sarah Overshon
 
 
Post #: 1
 
 RE: Closing A Spreadsheet - 4/30/2008 2:44:40 AM   
  Rischip


Posts: 378
Score: 2
Joined: 3/26/2007
Status: offline
ActiveWorkbook.Close False

Or

ActiveWorkbook.Close savechanges:=False

Or

ActiveWorkbook.Saved = True
ActiveWorkBook.Close

< Message edited by Rischip -- 4/30/2008 2:48:14 AM >


_____________________________

Rischip
Author of - The Grim Linker

(in reply to sarahbeth27)
 
 
Post #: 2
 
 RE: Closing A Spreadsheet - 4/30/2008 2:45:26 AM   
  ebgreen


Posts: 4595
Score: 29
Joined: 7/12/2005
Status: offline
I forget the setting but there is a setting that you can set before you close to avoid the confirmation. Check the object model documentation and I will check if I get a chance and post back here in case you can't find it.


So, yeah, what he said.

< Message edited by ebgreen -- 4/30/2008 2:47:49 AM >


_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to sarahbeth27)
 
 
Post #: 3
 
 RE: Closing A Spreadsheet - 5/2/2008 5:11:39 AM   
  ehvbs

 

Posts: 2012
Score: 48
Joined: 6/22/2005
From: Germany
Status: offline
From my (bad) memory: DisplayAlerts

(in reply to ebgreen)
 
 
Post #: 4
 
 RE: Closing A Spreadsheet - 5/2/2008 7:33:06 AM   
  dm_4ever


Posts: 2172
Score: 32
Joined: 6/29/2006
From: Orange County, California
Status: offline
Not so "bad" a memory because that is correct:
objExcel.DisplayAlerts = False

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to ehvbs)
 
 
Post #: 5
 
 RE: Closing A Spreadsheet - 5/2/2008 8:02:42 AM   
  Rischip


Posts: 378
Score: 2
Joined: 3/26/2007
Status: offline
quote:

ORIGINAL: sarahbeth27

But as i said i don't want the alert to pop up i just wnt it to close without saving.
Thanks


http://www.microsoft.com/technet/scriptcenter/resources/qanda/mar06/hey0307.mspx

This says that DisplayAlerts = False will use all defaults. The defaults being Save = Yes and Overwrite = Yes.
Not sure if that's what they want. But it definately will close without the pop-ups using that method.

_____________________________

Rischip
Author of - The Grim Linker

(in reply to sarahbeth27)
 
 
Post #: 6
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Closing A Spreadsheet Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts