Re: How to prevent dialog box

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Thanks Bob, it works perfect

David

"Bob Phillips" wrote:

> It is, but displayalerts = false overrides that and it gets saved.
>
> --
>
> HTH
>
> RP
> (remove nothere from the email address if mailing direct)
>
>
> "DavidE" <DavidE@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:9E8FC95D-21EA-4B7D-8AE5-E3204F4ACA11@xxxxxxxxxxxxxxxx
> > Hi Bob,
> > Thanks for your answers.
> > I have a question about Application.DisplayALerts = False.This is uses the
> > default of excel.
> > If I use SaveAs method the default is 'No' and I want that the default
> will
> > be 'yes'.
> > How can I do it ?
> >
> > Thanks
> > David
> >
> >
> > "Bob Phillips" wrote:
> >
> > > First bit.
> > >
> > > Application.DisplayALerts = False
> > >
> > > and reset afterwards.
> > >
> > > Second bit. See http://www.rondebruin.nl/mail/prevent.htm
> > >
> > > --
> > >
> > > HTH
> > >
> > > RP
> > > (remove nothere from the email address if mailing direct)
> > >
> > >
> > > "DavidE" <DavidE@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> > > news:84FBAB25-A2C6-49CB-B379-CA2DC8192523@xxxxxxxxxxxxxxxx
> > > > Hi,
> > > >
> > > > I add a control button to a workbook commandBar. I use this button to
> send
> > > > this workbook as an atachment to a recipient. The problems are that
> for
> > > add a
> > > > workbook as an attachment I think that I have to save it before to
> the
> > > hard
> > > > disc.
> > > > So, when I use the "SaveAs" method, The user get a dialog box which I
> want
> > > > to prevent.The dialog says that the file is exist and ask for replace
> it.
> > > I
> > > > tried to use "ConflictResolution:=xlLocalSessionChanges" to prevent
> this
> > > > dialog but it dosn't help.
> > > > The second problem is when I send the workbook as an atachment I get
> this
> > > > dialog box : " A program try to send a mail automatically with your
> name.
> > > Do
> > > > you want to send it ?..it can be a virus.. " .How can I prevent this
> > > dialog
> > > > too.
> > > > Here the code:
> > > > ThisWorkbook.SaveAs Filename:="C:\Program
> > > > Files\MyOutlookAddIn\SelectedVisits.xls",
> > > > ConflictResolution:=xlLocalSessionChanges
> > > > Set myOlApp = CreateObject("Outlook.Application")
> > > > Set newItem = myOlApp.CreateItem(olMailItem)
> > > > newItem.Attachments.Add "C:\Program
> > > > Files\MyOutlookAddIn\SelectedVisits.xls"
> > > > newItem.Subject = "Visitors"
> > > > newItem.To = "davide@xxxxxxxxxx"
> > > > newItem.Send
> > > >
> > > > Thanks
> > > >
> > > > David
> > > >
> > >
> > >
> > >
>
>
>
.



Relevant Pages

  • Re: remove vba and functions when saving worksheet
    ... >> HTH ... >> Bob Phillips ... >> (remove nothere from email address if mailing direct) ...
    (microsoft.public.excel.programming)
  • Re: Userform and Module
    ... >> you have a loop to me, the macro shows the form, which calls the macro, ... >> HTH ... >> Bob Phillips ... >> (remove nothere from email address if mailing direct) ...
    (microsoft.public.excel)
  • Re: Userform and Module
    ... >> HTH ... >> Bob Phillips ... >> (remove nothere from email address if mailing direct) ...
    (microsoft.public.excel)
  • Re: Random Number comparison
    ... > HTH ... > Bob Phillips ... > (remove nothere from email address if mailing direct) ...
    (microsoft.public.excel.programming)
  • Re: Will SUMPRODUCT work for this?
    ... >> HTH ... >> Bob Phillips ... >> (remove nothere from email address if mailing direct) ...
    (microsoft.public.excel.misc)