Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How to prevent dialog box

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 = "
newItem.Send

Thanks

David

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How to prevent dialog box

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" wrote in message
...
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 = "
newItem.Send

Thanks

David



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How to prevent dialog box

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" wrote in message
...
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 = "
newItem.Send

Thanks

David




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How to prevent dialog box

It is, but displayalerts = false overrides that and it gets saved.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"DavidE" wrote in message
...
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" wrote in message
...
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 = "
newItem.Send

Thanks

David






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How to prevent dialog box

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" wrote in message
...
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" wrote in message
...
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 = "
newItem.Send

Thanks

David







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
How to delete the "Insert Function Dialog Box" (dialog box only)? TBI''d biker Excel Worksheet Functions 2 April 7th 07 09:18 PM
HOW CAN I PREVENT EXCEL FILES FROM BEING DELETED OR PREVENT TRASH ROB Excel Discussion (Misc queries) 2 April 2nd 07 01:13 PM
control of dialog macro dialog box. on open Gerry Abbott Excel Programming 0 July 22nd 04 05:41 PM
How to prevent the MS Excel error dialog by errorhandling ? Oscar Excel Programming 1 January 7th 04 03:52 PM
Prevent dialog - Prevents Sending Excel File From Outlook JP[_7_] Excel Programming 7 August 18th 03 06:25 PM


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