Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Msg Box VBA Issue

I am using the following code:

Sub MBox()
Dim Config as Integer
Dim Ans As Integer
Config = vbYesNo + vbQuestion + vbDefaultButton2
Ans = MsgBox("Are you sure the correct Axiom reports are open in Excel?",
Config)
If Ans = vbYes Then RunReport
Then I have the report code
End Sub

Everything is just fine and dandy - the box pops up with yes and no - but
when I click Yes nothing happens. When I click No, the report runs for
however many times I clicked Yes. It is very strange. Any suggestions on how
to get this to work properly?

Charles
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Msg Box VBA Issue

Works as expected for me.

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"CJLuke" wrote in message
...
I am using the following code:

Sub MBox()
Dim Config as Integer
Dim Ans As Integer
Config = vbYesNo + vbQuestion + vbDefaultButton2
Ans = MsgBox("Are you sure the correct Axiom reports are open in Excel?",
Config)
If Ans = vbYes Then RunReport
Then I have the report code
End Sub

Everything is just fine and dandy - the box pops up with yes and no - but
when I click Yes nothing happens. When I click No, the report runs for
however many times I clicked Yes. It is very strange. Any suggestions on
how
to get this to work properly?

Charles



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Msg Box VBA Issue

Still screwy on my end...any suggestions? What does your code look like?

"Bob Phillips" wrote:

Works as expected for me.

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"CJLuke" wrote in message
...
I am using the following code:

Sub MBox()
Dim Config as Integer
Dim Ans As Integer
Config = vbYesNo + vbQuestion + vbDefaultButton2
Ans = MsgBox("Are you sure the correct Axiom reports are open in Excel?",
Config)
If Ans = vbYes Then RunReport
Then I have the report code
End Sub

Everything is just fine and dandy - the box pops up with yes and no - but
when I click Yes nothing happens. When I click No, the report runs for
however many times I clicked Yes. It is very strange. Any suggestions on
how
to get this to work properly?

Charles




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Msg Box VBA Issue

I just copied your code.

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"CJLuke" wrote in message
...
Still screwy on my end...any suggestions? What does your code look like?

"Bob Phillips" wrote:

Works as expected for me.

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"CJLuke" wrote in message
...
I am using the following code:

Sub MBox()
Dim Config as Integer
Dim Ans As Integer
Config = vbYesNo + vbQuestion + vbDefaultButton2
Ans = MsgBox("Are you sure the correct Axiom reports are open in
Excel?",
Config)
If Ans = vbYes Then RunReport
Then I have the report code
End Sub

Everything is just fine and dandy - the box pops up with yes and no -
but
when I click Yes nothing happens. When I click No, the report runs for
however many times I clicked Yes. It is very strange. Any suggestions
on
how
to get this to work properly?

Charles






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Msg Box VBA Issue

What is the code/sub routine for RunReport ?

On Jan 26, 10:30 am, CJLuke wrote:
I am using the following code:

Sub MBox()
Dim Config as Integer
Dim Ans As Integer
Config = vbYesNo + vbQuestion + vbDefaultButton2
Ans = MsgBox("Are you sure the correct Axiom reports are open in Excel?",
Config)
If Ans = vbYes Then RunReport
Then I have the report code
End Sub

Everything is just fine and dandy - the box pops up with yes and no - but
when I click Yes nothing happens. When I click No, the report runs for
however many times I clicked Yes. It is very strange. Any suggestions on how
to get this to work properly?

Charles




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Msg Box VBA Issue

charles......
i have had horrible trouble using msgboxes in this configuration.
somebody here taught me to use them in an "if" statement, & i find (for
me) they work much better.
i would ammend your code as follows:

Sub MBox()
If MsgBox("Are you sure the correct Axiom reports are open in Excel?" _
, vbYesNo + vbQuestion) = vbYes Then
run report
end if
' Then I have the report code
End Sub


watch the google line wrapping - that underscore belongs up with the
previous line.
susan



On Jan 25, 4:30 pm, CJLuke wrote:
I am using the following code:

Sub MBox()
Dim Config as Integer
Dim Ans As Integer
Config = vbYesNo + vbQuestion + vbDefaultButton2
Ans = MsgBox("Are you sure the correct Axiom reports are open in Excel?",
Config)
If Ans = vbYes Then RunReport
Then I have the report code
End Sub

Everything is just fine and dandy - the box pops up with yes and no - but
when I click Yes nothing happens. When I click No, the report runs for
however many times I clicked Yes. It is very strange. Any suggestions on how
to get this to work properly?

Charles


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Msg Box VBA Issue

Ok, using the IF statement works a lot better and at least the report runs
when I hit yes. However, when I hit no the report continues to run. How do I
just get the report to stop running when I hit no and to run when I hit yes.

Charles

"Susan" wrote:

charles......
i have had horrible trouble using msgboxes in this configuration.
somebody here taught me to use them in an "if" statement, & i find (for
me) they work much better.
i would ammend your code as follows:

Sub MBox()
If MsgBox("Are you sure the correct Axiom reports are open in Excel?" _
, vbYesNo + vbQuestion) = vbYes Then
run report
end if
' Then I have the report code
End Sub


watch the google line wrapping - that underscore belongs up with the
previous line.
susan



On Jan 25, 4:30 pm, CJLuke wrote:
I am using the following code:

Sub MBox()
Dim Config as Integer
Dim Ans As Integer
Config = vbYesNo + vbQuestion + vbDefaultButton2
Ans = MsgBox("Are you sure the correct Axiom reports are open in Excel?",
Config)
If Ans = vbYes Then RunReport
Then I have the report code
End Sub

Everything is just fine and dandy - the box pops up with yes and no - but
when I click Yes nothing happens. When I click No, the report runs for
however many times I clicked Yes. It is very strange. Any suggestions on how
to get this to work properly?

Charles



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Msg Box VBA Issue

If MsgBox("Are you sure the correct Axiom reports are open in Excel?" _
, vbYesNo + vbQuestion) = vbYes Then
run report

else
exit sub 'or whatever else you want it to do
end if



On Jan 26, 12:48 pm, CJLuke wrote:
Ok, using the IF statement works a lot better and at least the report runs
when I hit yes. However, when I hit no the report continues to run. How do I
just get the report to stop running when I hit no and to run when I hit yes.

Charles



"Susan" wrote:
charles......
i have had horrible trouble using msgboxes in this configuration.
somebody here taught me to use them in an "if" statement, & i find (for
me) they work much better.
i would ammend your code as follows:


Sub MBox()
If MsgBox("Are you sure the correct Axiom reports are open in Excel?" _
, vbYesNo + vbQuestion) = vbYes Then
run report
end if
' Then I have the report code
End Sub


watch the google line wrapping - that underscore belongs up with the
previous line.
susan


On Jan 25, 4:30 pm, CJLuke wrote:
I am using the following code:


Sub MBox()
Dim Config as Integer
Dim Ans As Integer
Config = vbYesNo + vbQuestion + vbDefaultButton2
Ans = MsgBox("Are you sure the correct Axiom reports are open in Excel?",
Config)
If Ans = vbYes Then RunReport
Then I have the report code
End Sub


Everything is just fine and dandy - the box pops up with yes and no - but
when I click Yes nothing happens. When I click No, the report runs for
however many times I clicked Yes. It is very strange. Any suggestions on how
to get this to work properly?


Charles- Hide quoted text -- Show quoted text -


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Msg Box VBA Issue

Got it! Thanks a ton...

"Susan" wrote:

If MsgBox("Are you sure the correct Axiom reports are open in Excel?" _
, vbYesNo + vbQuestion) = vbYes Then
run report

else
exit sub 'or whatever else you want it to do
end if



On Jan 26, 12:48 pm, CJLuke wrote:
Ok, using the IF statement works a lot better and at least the report runs
when I hit yes. However, when I hit no the report continues to run. How do I
just get the report to stop running when I hit no and to run when I hit yes.

Charles



"Susan" wrote:
charles......
i have had horrible trouble using msgboxes in this configuration.
somebody here taught me to use them in an "if" statement, & i find (for
me) they work much better.
i would ammend your code as follows:


Sub MBox()
If MsgBox("Are you sure the correct Axiom reports are open in Excel?" _
, vbYesNo + vbQuestion) = vbYes Then
run report
end if
' Then I have the report code
End Sub


watch the google line wrapping - that underscore belongs up with the
previous line.
susan


On Jan 25, 4:30 pm, CJLuke wrote:
I am using the following code:


Sub MBox()
Dim Config as Integer
Dim Ans As Integer
Config = vbYesNo + vbQuestion + vbDefaultButton2
Ans = MsgBox("Are you sure the correct Axiom reports are open in Excel?",
Config)
If Ans = vbYes Then RunReport
Then I have the report code
End Sub


Everything is just fine and dandy - the box pops up with yes and no - but
when I click Yes nothing happens. When I click No, the report runs for
however many times I clicked Yes. It is very strange. Any suggestions on how
to get this to work properly?


Charles- Hide quoted text -- Show quoted text -



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
same issue Dink Charts and Charting in Excel 1 October 3rd 09 10:40 AM
I believe that this is a set up issue... jsylvester Setting up and Configuration of Excel 2 January 21st 09 06:41 PM
For Next Issue darkman Excel Programming 5 May 24th 06 08:40 AM
UDF & Add-in Issue MSweetG222 Excel Programming 2 March 7th 06 01:05 PM
With and End With issue Pat Excel Programming 4 May 3rd 05 10:20 PM


All times are GMT +1. The time now is 05:41 AM.

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"