 |
|
|
|
| Author |
Message |
bbnimda
Joined: 13 Aug 2007 Posts: 46
|
Posted: Wed Jan 23, 2008 3:46 pm Post subject: 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
Archived from group: microsoft>public>outlook>program_vba |
|
| Back to top |
|
 |
JP
Joined: 21 Nov 2007 Posts: 33
|
Posted: Wed Jan 23, 2008 11:38 am Post subject: Re: 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 |
|
| Back to top |
|
 |
bbnimda
Joined: 13 Aug 2007 Posts: 46
|
Posted: Thu Jan 24, 2008 1:37 pm Post subject: Re: How to overwrite a file automaticaly |
|
|
No it doesn't work
"JP" a écrit dans le message de news:
f3299436-7b86-4f7b-89aa-e852201e23ff@i12g2000prf.googlegroups.com...
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 |
|
| Back to top |
|
 |
JP
Joined: 21 Nov 2007 Posts: 33
|
Posted: Thu Jan 24, 2008 8:41 am Post subject: Re: 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:
> f3299436-7b86-4f7b-89aa-e852201e2...@i12g2000prf.googlegroups.com...
> 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
> |
|
| Back to top |
|
 |
bbnimda
Joined: 13 Aug 2007 Posts: 46
|
Posted: Thu Jan 24, 2008 7:20 pm Post subject: Re: 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:
26570aca-c713-41b4-bb8d-0e01424f312e@s12g2000prg.googlegroups.com...
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:
> f3299436-7b86-4f7b-89aa-e852201e2...@i12g2000prf.googlegroups.com...
> 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
> |
|
| Back to top |
|
 |
JP
Joined: 21 Nov 2007 Posts: 33
|
Posted: Thu Jan 24, 2008 7:17 pm Post subject: Re: 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:
> 26570aca-c713-41b4-bb8d-0e01424f3...@s12g2000prg.googlegroups.com...
> 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
>
|
|
| Back to top |
|
 |
|
|
| Related Topics: | How to save a email, sent out, as a file Hi, What I need is to save an email which is sent out from MSO as a file, which is a frozen copy of the mail sent. 1. To do the above I need to find out the mail from Sent Items for the mail which was sent out from Outbox. What I know is the EntryId chang
rename msg file automaticly I have made some shortcuts in the quicklaunch bar to mailfolders from my projects in Explorer. When I drag and drop emails from Outlook 2003 on those shortcuts, the mails are archived on the right place. At the company I work, this is the only way to arch
Writing data on a XML file on internet Hello, I am still a beginner in VBA... I am searching a way to write/modify data in a xml file on internet from a macro in Outlook. I found a way, with and get method, to read some text data in a file, or get the whole file,
Save a copy to file when sending. Part of my job rquires me to save all sent emails regerding a particular project to a file on our server. This is a bit laborious and I wonder if there is some code that will help. What I would like to start with is if the subject line starts with 3 numbe
Adding af signature file at the end of the body text Hi I tried to put in the signature after I have made a mailtext in VBA , but the text is replaced by the signature the code is like this v=" Myletter text" With OutMail .to = "yyy@xxx.com" .CC = "" .BCC = "" .Subject = "Subject text" .body = v & Chr(13) |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|