A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How to overwrite a file automaticaly



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 23rd 08, 10:46 AM posted to microsoft.public.outlook.program_vba
bbnimda
external usenet poster
 
Posts: 94
Default How to overwrite a file automaticaly

Hi all,

I'm using this in outlook script , but if the file exist the system display
a message and ask me if I want to overwrite it

objExcelApp.ActiveWorkbook.SaveAs \\Backup\mybackup.xls"

is there a way to bypass the message and save the file without displaying
the message ?

Tks

--
Knowlege grows when shared.

http://bensoft.miniville.fr/tra


  #2  
Old January 23rd 08, 03:38 PM posted to microsoft.public.outlook.program_vba
JP[_3_]
external usenet poster
 
Posts: 201
Default How to overwrite a file automaticaly

Application.DisplayAlerts = False
objExcelApp.ActiveWorkbook.SaveAs "\\Backup\mybackup.xls"
Application.DisplayAlerts = True

or

Kill "\\Backup\mybackup.xls"
objExcelApp.ActiveWorkbook.SaveAs "\\Backup\mybackup.xls"


HTH,
JP

On Jan 23, 4:46*am, "bbnimda" wrote:
Hi all,

I'm using this in outlook script , but if the file exist the system *display
a message and ask me if I want to overwrite it

objExcelApp.ActiveWorkbook.SaveAs \\Backup\mybackup.xls"

is there a way to bypass the message and save the file without displaying
the message ?

Tks

--
Knowlege grows when shared.

http://bensoft.miniville.fr/tra


  #4  
Old January 24th 08, 12:41 PM posted to microsoft.public.outlook.program_vba
JP[_3_]
external usenet poster
 
Posts: 201
Default How to overwrite a file automaticaly

Can you be more specific?

Did you step through the code? If so, what line caused the error? And
what was the error message?

What version of Outlook are you using, and where exactly are you using
the code (class module, userform, outlook form, etc)?


Thx,
JP


On Jan 24, 2:37*am, "bbnimda" wrote:
No it doesn't *work

"JP" a écrit dans le message de news:
...
Application.DisplayAlerts = False
objExcelApp.ActiveWorkbook.SaveAs "\\Backup\mybackup.xls"
Application.DisplayAlerts = True

or

Kill "\\Backup\mybackup.xls"
objExcelApp.ActiveWorkbook.SaveAs "\\Backup\mybackup.xls"

HTH,
JP

  #5  
Old January 24th 08, 02:20 PM posted to microsoft.public.outlook.program_vba
bbnimda
external usenet poster
 
Posts: 94
Default How to overwrite a file automaticaly

I tryed the two method above, but It doesn't change anything , I still have
a message asking me If I want to Overwrite the existing file.

Application.DisplayAlerts = False
objExcelApp.ActiveWorkbook.SaveAs "\\Backup\mybackup.xls"
Application.DisplayAlerts = True

and

Kill "\\Backup\mybackup.xls"
objExcelApp.ActiveWorkbook.SaveAs "\\Backup\mybackup.xls"




"JP" a écrit dans le message de news:
...
Can you be more specific?

Did you step through the code? If so, what line caused the error? And
what was the error message?

What version of Outlook are you using, and where exactly are you using
the code (class module, userform, outlook form, etc)?


Thx,
JP


On Jan 24, 2:37 am, "bbnimda" wrote:
No it doesn't work

"JP" a écrit dans le message de news:
...
Application.DisplayAlerts = False
objExcelApp.ActiveWorkbook.SaveAs "\\Backup\mybackup.xls"
Application.DisplayAlerts = True

or

Kill "\\Backup\mybackup.xls"
objExcelApp.ActiveWorkbook.SaveAs "\\Backup\mybackup.xls"

HTH,
JP



  #6  
Old January 24th 08, 11:17 PM posted to microsoft.public.outlook.program_vba
JP[_3_]
external usenet poster
 
Posts: 201
Default How to overwrite a file automaticaly

My bad, try this:

objExcelApp.DisplayAlerts = False
objExcelApp.ActiveWorkbook.SaveAs "\\Backup\mybackup.xls"
objExcelApp.DisplayAlerts = True

'Application' is referring to Outlook, so the code should fail, so it
should be 'objExcelApp' because that is the reference to the Excel
application.


HTH,
JP




On Jan 24, 8:20*am, "bbnimda" wrote:
I tryed the two method above, but It doesn't change anything , I still have
a message asking me If I want to Overwrite the existing file.

Application.DisplayAlerts = False
objExcelApp.ActiveWorkbook.SaveAs "\\Backup\mybackup.xls"
Application.DisplayAlerts = True

and

Kill "\\Backup\mybackup.xls"
objExcelApp.ActiveWorkbook.SaveAs "\\Backup\mybackup.xls"

"JP" a écrit dans le message de news:
...
Can you be more specific?

Did you step through the code? If so, what line caused the error? And
what was the error message?

What version of Outlook are you using, and where exactly are you using
the code (class module, userform, outlook form, etc)?

Thx,
JP

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
copy and overwrite ??? -can't get rid og duplicate messages !!! Claus Top Outlook - General Queries 0 February 8th 07 12:06 PM
why does outlook shortcut overwrite my other mail client? steve Outlook - Installation 1 June 4th 06 02:56 PM
Attachment duplicate/overwrite problem in 2003 Opus Outlook - General Queries 7 May 15th 06 02:13 AM
overwrite reminder for accepted meeting invitations Phil41 Outlook - Calandaring 1 March 9th 06 02:52 PM
Overwrite Mode Neetz Outlook - General Queries 0 February 21st 06 06:47 PM


All times are GMT +1. The time now is 08:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.