Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / January 2008

Tip: Looking for answers? Try searching our database.

How to overwrite a file automaticaly

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bbnimda - 23 Jan 2008 09:46 GMT
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

Signature

Knowlege grows when shared.

http://bensoft.miniville.fr/tra

JP - 23 Jan 2008 14:38 GMT
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

> Hi all,
>
[quoted text clipped - 12 lines]
>
> http://bensoft.miniville.fr/tra
bbnimda - 24 Jan 2008 07:37 GMT
No it doesn't  work :(

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" <wahhhran-...@yahoo.fr> wrote:
> Hi all,
>
[quoted text clipped - 13 lines]
>
> http://bensoft.miniville.fr/tra
JP - 24 Jan 2008 11:41 GMT
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

> No it doesn't  work :(
>
[quoted text clipped - 11 lines]
> HTH,
> JP
bbnimda - 24 Jan 2008 13:20 GMT
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"

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" <wahhhran-...@yahoo.fr> wrote:
> No it doesn't work :(
>
[quoted text clipped - 11 lines]
> HTH,
> JP
JP - 24 Jan 2008 22:17 GMT
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

> 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.
[quoted text clipped - 20 lines]
> Thx,
> JP
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.