Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default disabling a message box

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
--
Regards,

timmulla
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default disabling a message box

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default disabling a message box

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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default disabling a message box

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


  #5   Report Post  
Posted to microsoft.public.excel.programming
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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default disabling a message box

If the message box is produced by code in the workbook you are opening, then
you can suppress that code from running

Application.EnableEvents = False
' open and process the workbook
Application.EnableEvents = True

--
Regards,
Tom Ogilvy

"timmulla" wrote in message
...
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



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default disabling a message box


Tim,
Application.DisplayAlerts should take care of getting rid of both
of your unwanted message boxes. If you post your code and indicate
where the two message boxes are popping up then we may be able to
decipher the problem.


--
bhofsetz
------------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...o&userid=18807
View this thread: http://www.excelforum.com/showthread...hreadid=389381

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default disabling a message box

Guess I got lead astray by Roy's response. You are correct that
Application.DisplayAlerts should suppress the second message. However, that
was JE's original suggestion

Wrap your Save/SaveAs method with

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


and Tim claims it didn't. The first message wouldn't be produced by saving
the workbook - but that is the one he claimed it cured.

--
Regards,
Tom Ogilvy

"bhofsetz" wrote in
message ...

Tim,
Application.DisplayAlerts should take care of getting rid of both
of your unwanted message boxes. If you post your code and indicate
where the two message boxes are popping up then we may be able to
decipher the problem.


--
bhofsetz
------------------------------------------------------------------------
bhofsetz's Profile:

http://www.excelforum.com/member.php...o&userid=18807
View this thread: http://www.excelforum.com/showthread...hreadid=389381



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default disabling a message box

Thanks all for your help!

Here's a copy of my code: The code is opening another file and running a
macro and then saving it as a text file.


Private Sub Workbook_Open()

Application.ScreenUpdating = False

ChDir "H:\QuickBooks\Finance\MIP\MONTHLY GL UPLOAD FILES"
Workbooks.Open Filename:= _
"H:\QuickBooks\Finance\MIP\MONTHLY GL UPLOAD FILES\Consolidated
Programs import MONTHLY GL UPLOAD.xls"
Application.Run "'Consolidated Programs import MONTHLY GL
UPLOAD.xls'!Macro2"
ActiveWorkbook.SaveAs Filename:= _
"H:\QuickBooks\Finance\MIP\MONTHLY GL UPLOAD FILES\Consolidated
Programs import MONTHLY GL UPLOAD.txt" _
, FileFormat:=xlText, CreateBackup:=False

Application.DisplayAlerts = False
ActiveWorkbook.Save
ActiveWindow.Close
Application.DisplayAlerts = True

Application.ScreenUpdating = False



UserForm1.Show False


With UserForm1.cmbprgimpt
.AddItem "54000"
.AddItem "54001"
.AddItem "54002"
.AddItem "54010"
.AddItem "54020"
.AddItem "54040"
.AddItem "Consolidated Programs import"

End With



End Sub

Any help would be appreciated.

--
Regards,

timmulla


"bhofsetz" wrote:


Tim,
Application.DisplayAlerts should take care of getting rid of both
of your unwanted message boxes. If you post your code and indicate
where the two message boxes are popping up then we may be able to
decipher the problem.


--
bhofsetz
------------------------------------------------------------------------
bhofsetz's Profile: http://www.excelforum.com/member.php...o&userid=18807
View this thread: http://www.excelforum.com/showthread...hreadid=389381


  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default disabling a message box

Private Sub Workbook_Open()

Application.ScreenUpdating = False

ChDir "H:\QuickBooks\Finance\MIP\MONTHLY GL UPLOAD FILES"
Workbooks.Open Filename:= _
"H:\QuickBooks\Finance\MIP\MONTHLY GL UPLOAD FILES\Consolidated
Programs import MONTHLY GL UPLOAD.xls"
Application.Run "'Consolidated Programs import MONTHLY GL
UPLOAD.xls'!Macro2"

Application.DisplayAlerts = False



ActiveWorkbook.SaveAs Filename:= _
"H:\QuickBooks\Finance\MIP\MONTHLY GL UPLOAD FILES\Consolidated
Programs import MONTHLY GL UPLOAD.txt" _
, FileFormat:=xlText, CreateBackup:=False

ActiveWindow.Close SaveChanges:=True
Application.DisplayAlerts = True

Application.ScreenUpdating = False



UserForm1.Show False


With UserForm1.cmbprgimpt
.AddItem "54000"
.AddItem "54001"
.AddItem "54002"
.AddItem "54010"
.AddItem "54020"
.AddItem "54040"
.AddItem "Consolidated Programs import"

End With



End Sub

--
Regards,
Tom Ogilvy


"timmulla" wrote in message
...
Thanks all for your help!

Here's a copy of my code: The code is opening another file and running a
macro and then saving it as a text file.


Private Sub Workbook_Open()

Application.ScreenUpdating = False

ChDir "H:\QuickBooks\Finance\MIP\MONTHLY GL UPLOAD FILES"
Workbooks.Open Filename:= _
"H:\QuickBooks\Finance\MIP\MONTHLY GL UPLOAD FILES\Consolidated
Programs import MONTHLY GL UPLOAD.xls"
Application.Run "'Consolidated Programs import MONTHLY GL
UPLOAD.xls'!Macro2"
ActiveWorkbook.SaveAs Filename:= _
"H:\QuickBooks\Finance\MIP\MONTHLY GL UPLOAD FILES\Consolidated
Programs import MONTHLY GL UPLOAD.txt" _
, FileFormat:=xlText, CreateBackup:=False

Application.DisplayAlerts = False
ActiveWorkbook.Save
ActiveWindow.Close
Application.DisplayAlerts = True

Application.ScreenUpdating = False



UserForm1.Show False


With UserForm1.cmbprgimpt
.AddItem "54000"
.AddItem "54001"
.AddItem "54002"
.AddItem "54010"
.AddItem "54020"
.AddItem "54040"
.AddItem "Consolidated Programs import"

End With



End Sub

Any help would be appreciated.

--
Regards,

timmulla


"bhofsetz" wrote:


Tim,
Application.DisplayAlerts should take care of getting rid of both
of your unwanted message boxes. If you post your code and indicate
where the two message boxes are popping up then we may be able to
decipher the problem.


--
bhofsetz
------------------------------------------------------------------------
bhofsetz's Profile:

http://www.excelforum.com/member.php...o&userid=18807
View this thread:

http://www.excelforum.com/showthread...hreadid=389381






  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default disabling a message box

Thanks for your help!
--
Regards,

timmulla


"Tom Ogilvy" wrote:

Private Sub Workbook_Open()

Application.ScreenUpdating = False

ChDir "H:\QuickBooks\Finance\MIP\MONTHLY GL UPLOAD FILES"
Workbooks.Open Filename:= _
"H:\QuickBooks\Finance\MIP\MONTHLY GL UPLOAD FILES\Consolidated
Programs import MONTHLY GL UPLOAD.xls"
Application.Run "'Consolidated Programs import MONTHLY GL
UPLOAD.xls'!Macro2"

Application.DisplayAlerts = False



ActiveWorkbook.SaveAs Filename:= _
"H:\QuickBooks\Finance\MIP\MONTHLY GL UPLOAD FILES\Consolidated
Programs import MONTHLY GL UPLOAD.txt" _
, FileFormat:=xlText, CreateBackup:=False

ActiveWindow.Close SaveChanges:=True
Application.DisplayAlerts = True

Application.ScreenUpdating = False



UserForm1.Show False


With UserForm1.cmbprgimpt
.AddItem "54000"
.AddItem "54001"
.AddItem "54002"
.AddItem "54010"
.AddItem "54020"
.AddItem "54040"
.AddItem "Consolidated Programs import"

End With



End Sub

--
Regards,
Tom Ogilvy


"timmulla" wrote in message
...
Thanks all for your help!

Here's a copy of my code: The code is opening another file and running a
macro and then saving it as a text file.


Private Sub Workbook_Open()

Application.ScreenUpdating = False

ChDir "H:\QuickBooks\Finance\MIP\MONTHLY GL UPLOAD FILES"
Workbooks.Open Filename:= _
"H:\QuickBooks\Finance\MIP\MONTHLY GL UPLOAD FILES\Consolidated
Programs import MONTHLY GL UPLOAD.xls"
Application.Run "'Consolidated Programs import MONTHLY GL
UPLOAD.xls'!Macro2"
ActiveWorkbook.SaveAs Filename:= _
"H:\QuickBooks\Finance\MIP\MONTHLY GL UPLOAD FILES\Consolidated
Programs import MONTHLY GL UPLOAD.txt" _
, FileFormat:=xlText, CreateBackup:=False

Application.DisplayAlerts = False
ActiveWorkbook.Save
ActiveWindow.Close
Application.DisplayAlerts = True

Application.ScreenUpdating = False



UserForm1.Show False


With UserForm1.cmbprgimpt
.AddItem "54000"
.AddItem "54001"
.AddItem "54002"
.AddItem "54010"
.AddItem "54020"
.AddItem "54040"
.AddItem "Consolidated Programs import"

End With



End Sub

Any help would be appreciated.

--
Regards,

timmulla


"bhofsetz" wrote:


Tim,
Application.DisplayAlerts should take care of getting rid of both
of your unwanted message boxes. If you post your code and indicate
where the two message boxes are popping up then we may be able to
decipher the problem.


--
bhofsetz
------------------------------------------------------------------------
bhofsetz's Profile:

http://www.excelforum.com/member.php...o&userid=18807
View this thread:

http://www.excelforum.com/showthread...hreadid=389381





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
Disabling updatelinks Dave Excel Discussion (Misc queries) 0 April 27th 06 12:05 PM
Displaying a message in a message box without requiring user to click anything to proceed Android[_2_] Excel Programming 2 June 25th 04 06:44 PM
Disabling Alt+F11 richard_b2004 Excel Programming 3 May 17th 04 06:32 PM
Question about disabling message boxes if possible TBA[_2_] Excel Programming 1 January 18th 04 12:52 AM
Disabling the Update links message L Buchy Excel Programming 2 July 23rd 03 06:38 PM


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