View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
timmulla timmulla is offline
external usenet poster
 
Posts: 46
Default disabling a message box

Hi Roy,

Thanks for trying to help me out. Unfortunetly, the code you provided me
just created a seperate message box, and didn't default the original to yes.


--
Regards,

timmulla


"Roy Wagner" wrote:

Try this...

x = MsgBox("Default to yes", vbYesNoCancel + vbDefaultButton1, "Default")

Roy
--
(delete .nospam)




"timmulla" wrote:

Thanks for your help JE McGimpsey!

It solved my first problem successfully. Do you, or anyone else know how to
help me with the second problem? I need to default the following message box
to yes:

A file named "'Consolidated Programs import MONTHLY GL UPLOAD.txt already
exists, do you want to replace it?

I'm going to be replacing the file under the same name each time I use the
macro.

Thanks again for your help!
--
Regards,

timmulla


"JE McGimpsey" wrote:

Wrap your Save/SaveAs method with

Application.DisplayAlerts = False
'Save
Application.DisplayAlerts = True



In article ,
"timmulla" wrote:

I was wondering if anyone could help me with a macro I'm creating?

I'm trying to disable a message box "Do you want to save changes to
'Consolidated Programs import MONTHLY GL UPLOAD.txt" which pops up when my
macro is running. I want this to automatically default to yes each time the
macro is run. I also want the message box that says "'Consolidated Programs
import MONTHLY GL UPLOAD.txt already exists, do you want to replace it? To
default to yes as well.

Basically, I'm running a open workbook macro in one file to convert the
"Consolidated Programs import MONTHLY GL UPLOAD.xls" to a text file. The
message boxes are stopping the rest of my code from executing.

Any help would be appreciated.

Thanks,

Tim