Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default save a excel sheet in vba

Hello,

If I want to save a excel sheet in vba I use:

Workbooks(_FileName).Close SaveChanges:=True

but a question like "a file named ... is always existing, do you want
to exange it? <Yes <No <Cancel"

how can i do in order to save my file without such query?

Regards,

Jean-Noel
  #2   Report Post  
Posted to microsoft.public.excel.programming
ijb ijb is offline
external usenet poster
 
Posts: 26
Default save a excel sheet in vba

This should work:

Application.DisplayAlerts = False
Workbooks("ijb.xls").Close SaveChanges:=True
Application.DisplayAlerts = True

--
If I've mis-understood the question please tell me.

HTH

ijb

Remove nospam from my e-mail address to talk direct

Not MCSD, MVP, TLA, P&P, PCMCIA, etc just trying to help


"Jean-Noel Dotter" wrote in message
om...
Hello,

If I want to save a excel sheet in vba I use:

Workbooks(_FileName).Close SaveChanges:=True

but a question like "a file named ... is always existing, do you want
to exange it? <Yes <No <Cancel"

how can i do in order to save my file without such query?

Regards,

Jean-Noel



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default save a excel sheet in vba

Jean-Noel,

Put
Application.DisplayAlerts = False

and reset afterwards



--

HTH

Bob Phillips

"Jean-Noel Dotter" wrote in message
om...
Hello,

If I want to save a excel sheet in vba I use:

Workbooks(_FileName).Close SaveChanges:=True

but a question like "a file named ... is always existing, do you want
to exange it? <Yes <No <Cancel"

how can i do in order to save my file without such query?

Regards,

Jean-Noel



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default save a excel sheet in vba

Try:

Application.DisplayAlerts = False
Workbooks(_FileName).Close SaveChanges:=True
Application.DisplayAlerts = True

Tokash

-----Original Message-----
Hello,

If I want to save a excel sheet in vba I use:

Workbooks(_FileName).Close SaveChanges:=True

but a question like "a file named ... is always existing,

do you want
to exange it? <Yes <No <Cancel"

how can i do in order to save my file without such query?

Regards,

Jean-Noel
.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default save a excel sheet in vba

There are two main ways of stopping the save confirmation dialog appearing.

Application.DisplayAlerts = False will suppress the dialog box from
appearing in the first place.
Workbooks("fred").Close SaveChanges:=True
A couple of points to note:

If using the first option remember to turn the alerts back on (True) when
you're done.
The SaveChanges property will only work as you expect if the file access
etc. is read/write. I mention this as people have assumed the method
doesn't work but it's been due to workbooks opened in read only mode etc.


http://www.billlunney.com/Excel/FAQ/...?ExcelFAQID=75


--
Regards,


Bill Lunney
www.billlunney.com

"Jean-Noel Dotter" wrote in message
om...
Hello,

If I want to save a excel sheet in vba I use:

Workbooks(_FileName).Close SaveChanges:=True

but a question like "a file named ... is always existing, do you want
to exange it? <Yes <No <Cancel"

how can i do in order to save my file without such query?

Regards,

Jean-Noel



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
Save Excel spread sheet Wayne Excel Discussion (Misc queries) 7 November 9th 08 09:28 PM
Save excel sheet ielmrani via OfficeKB.com Excel Discussion (Misc queries) 15 June 24th 08 02:21 PM
Save, save as, page setup dimmed out in unprotected excel sheet? ccKeithJ Excel Discussion (Misc queries) 3 December 14th 07 07:07 PM
VBA code to save excel sheet [email protected] Excel Discussion (Misc queries) 1 March 17th 07 04:20 AM
save from template to excel sheet ELZNHS00 Excel Discussion (Misc queries) 0 August 2nd 06 05:51 PM


All times are GMT +1. The time now is 08:35 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"