Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
same issue | Charts and Charting in Excel | |||
I believe that this is a set up issue... | Setting up and Configuration of Excel | |||
For Next Issue | Excel Programming | |||
UDF & Add-in Issue | Excel Programming | |||
With and End With issue | Excel Programming |