Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Suppressing dialog boxes

My Excel macro at several points performs some cut'n'pasting, and the dialog
box appears :
"A formula or sheet you want to move or copy contains the name 'Parnerlist'
which already exists on the destination worksheet. Do you want to use this
version of the name?"
I want the macro to accept a "Yes" programatically and carry on working.
I'm sure there's an easy answer but I haven't found it. Can anyone help?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Suppressing dialog boxes

This produces a message box with your question in it. If the user clicks Yes
then
the code continues as currently written. If the user clicks No then code
that you have yet to compose will execute to change the name of whatever it
is the user is working with and then continue with currently written code.

Msg = "A formula or sheet you want to move or copy contains the name
'Parnerlist'
which already exists on the destination worksheet. Do you want to use this
version of the name?"
doWhat = MsgBox(Msg, vbYesNo + vbQuestion, "MAKE A CHOICE")
If doWhat = vbYes Then
'Do nothing
Else
'Code to change name
End If

"Sian" wrote:

My Excel macro at several points performs some cut'n'pasting, and the dialog
box appears :
"A formula or sheet you want to move or copy contains the name 'Parnerlist'
which already exists on the destination worksheet. Do you want to use this
version of the name?"
I want the macro to accept a "Yes" programatically and carry on working.
I'm sure there's an easy answer but I haven't found it. Can anyone help?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Suppressing dialog boxes

I see I didn't explain myself very well (well, it is Friday pm!!). I don't
want the dialog box to appear at all - at the moment the user has to sit
there clicking "Yes" 20 times

"JLGWhiz" wrote:

This produces a message box with your question in it. If the user clicks Yes
then
the code continues as currently written. If the user clicks No then code
that you have yet to compose will execute to change the name of whatever it
is the user is working with and then continue with currently written code.

Msg = "A formula or sheet you want to move or copy contains the name
'Parnerlist'
which already exists on the destination worksheet. Do you want to use this
version of the name?"
doWhat = MsgBox(Msg, vbYesNo + vbQuestion, "MAKE A CHOICE")
If doWhat = vbYes Then
'Do nothing
Else
'Code to change name
End If

"Sian" wrote:

My Excel macro at several points performs some cut'n'pasting, and the dialog
box appears :
"A formula or sheet you want to move or copy contains the name 'Parnerlist'
which already exists on the destination worksheet. Do you want to use this
version of the name?"
I want the macro to accept a "Yes" programatically and carry on working.
I'm sure there's an easy answer but I haven't found it. Can anyone help?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Suppressing dialog boxes

I am not sure you can use:

Application.DisplayAlerts = False

Then, at a point when the cut and paste is finished:

Application.DisplayAlerts = True

It is difficult to analyze without the code being posted.

"Sian" wrote:

I see I didn't explain myself very well (well, it is Friday pm!!). I don't
want the dialog box to appear at all - at the moment the user has to sit
there clicking "Yes" 20 times

"JLGWhiz" wrote:

This produces a message box with your question in it. If the user clicks Yes
then
the code continues as currently written. If the user clicks No then code
that you have yet to compose will execute to change the name of whatever it
is the user is working with and then continue with currently written code.

Msg = "A formula or sheet you want to move or copy contains the name
'Parnerlist'
which already exists on the destination worksheet. Do you want to use this
version of the name?"
doWhat = MsgBox(Msg, vbYesNo + vbQuestion, "MAKE A CHOICE")
If doWhat = vbYes Then
'Do nothing
Else
'Code to change name
End If

"Sian" wrote:

My Excel macro at several points performs some cut'n'pasting, and the dialog
box appears :
"A formula or sheet you want to move or copy contains the name 'Parnerlist'
which already exists on the destination worksheet. Do you want to use this
version of the name?"
I want the macro to accept a "Yes" programatically and carry on working.
I'm sure there's an easy answer but I haven't found it. Can anyone help?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Suppressing dialog boxes

That worked - thank you!

"JLGWhiz" wrote:

I am not sure you can use:

Application.DisplayAlerts = False

Then, at a point when the cut and paste is finished:

Application.DisplayAlerts = True

It is difficult to analyze without the code being posted.

"Sian" wrote:

I see I didn't explain myself very well (well, it is Friday pm!!). I don't
want the dialog box to appear at all - at the moment the user has to sit
there clicking "Yes" 20 times

"JLGWhiz" wrote:

This produces a message box with your question in it. If the user clicks Yes
then
the code continues as currently written. If the user clicks No then code
that you have yet to compose will execute to change the name of whatever it
is the user is working with and then continue with currently written code.

Msg = "A formula or sheet you want to move or copy contains the name
'Parnerlist'
which already exists on the destination worksheet. Do you want to use this
version of the name?"
doWhat = MsgBox(Msg, vbYesNo + vbQuestion, "MAKE A CHOICE")
If doWhat = vbYes Then
'Do nothing
Else
'Code to change name
End If

"Sian" wrote:

My Excel macro at several points performs some cut'n'pasting, and the dialog
box appears :
"A formula or sheet you want to move or copy contains the name 'Parnerlist'
which already exists on the destination worksheet. Do you want to use this
version of the name?"
I want the macro to accept a "Yes" programatically and carry on working.
I'm sure there's an easy answer but I haven't found it. Can anyone help?

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
Dialog Boxes stacy05 Excel Discussion (Misc queries) 8 February 5th 08 02:02 AM
suppressing auto-dailog boxes Chas Excel Programming 1 October 21st 05 05:44 PM
Dialog Boxes naiveprogrammer Excel Discussion (Misc queries) 2 October 18th 05 10:30 PM
Dialog boxes webster Excel Discussion (Misc queries) 5 July 9th 05 11:16 AM
Suppressing or turning off the Printing dialog Jeff Lefebvre Excel Programming 4 February 8th 05 11:17 PM


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