PC Review


Reply
Thread Tools Rate Thread

Close excel file wothout prompt (vbscript)

 
 
Karuna
Guest
Posts: n/a
 
      10th Sep 2008
Hello,

I have a vbscript that edits one of the excel file. When I try to close the
file using the below code, it prompts me "Do you want to save changes you
made to test.xls".

Set obj = CreateObject("excel.application")
Set objExcel1 = obj.Workbooks.Open("C:\test.xls")
..
..
..
objExcel1.Close

I want this excel sheet to be closed without saving the changes made during
the execution of the script. I dont want to have manual intervension where it
asks prompts me to click "yes", "no" or "cancel".

Awaiting for anyone who can share their view in this regard.

Thanks in advance.
Karuna.
 
Reply With Quote
 
 
 
 
Karuna
Guest
Posts: n/a
 
      10th Sep 2008


"Karuna" wrote:

> Hello,
>
> I have a vbscript that edits one of the excel file. When I try to close the
> file using the below code, it prompts me "Do you want to save changes you
> made to test.xls".
>
> Set obj = CreateObject("excel.application")
> Set objExcel1 = obj.Workbooks.Open("C:\test.xls")
> .
> .
> .
> objExcel1.Close
>
> I want this excel sheet to be closed without saving the changes made during
> the execution of the script. I dont want to have manual intervension where it
> asks prompts me to click "yes", "no" or "cancel".
>
> Awaiting for anyone who can share their view in this regard.
>
> Thanks in advance.
> Karuna.


I got the solution :
objExcel.Close False
 
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 force close the worksheet without having Excel prompt? Jack Microsoft Excel Programming 6 9th Jul 2008 11:22 PM
File/Close automatically saving changes without prompt Joe@SAA Microsoft Excel Misc 0 23rd Jun 2008 10:31 PM
Intercepting the file save prompt before close? =?Utf-8?B?TmVpbCBCaGFuZGFy?= Microsoft Excel Programming 3 14th Feb 2006 03:19 AM
Save an excel file in vbscript without user prompt mattsmith2@gmail.com Microsoft Excel Programming 2 18th Jan 2006 03:48 PM
Excel Open, Close, Save, SaveAs Arguments in VBScript Mark Ritchey Microsoft ASP .NET 0 10th Dec 2003 03:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:30 PM.