ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Assistant.NewBalloon test (https://www.excelbanter.com/excel-programming/304471-assistant-newballoon-test.html)

jeffP

Assistant.NewBalloon test
 
Hi all,
I made a new balloon and I want to test the answer of the
msobuttonsetYesNoCancel
As you may know no matter what button is selected it returns 5. Or if
using
msobuttonsetYesNo then the return is 4. Or AbortRetryIgnore is a constant
10.
The object browser tells me they are assigned these constant values but I
don't get it. I'm sure the buttons can be tested,because otherwise there
would be no need for more than one button.
I want to test the buttons just like vbyes from a msgbox but obviously I'm
lost.

Any help and explanations are always appreciated.


--
jeffP





Wouter[_2_]

Assistant.NewBalloon test
 
Hi Jeff,

I worked out this:

Sub MyBalloon()
Dim blnMy As Balloon
Dim lngChoosen As Long

Set blnMy = Assistant.NewBalloon
With blnMy
.BalloonType = msoBalloonTypeBullets
.Icon = msoIconTip
.Button = msoButtonSetOkCancel
.Heading = "Tips voor het opslaan van gegevens."
.Labels(1).Text = "Your first line of text"
.Labels(2).Text = "Your second line of text"
lngChoosen = .Show
End With
MsgBox "OK:" & vbTab & (lngChoosen = msoBalloonButtonOK) & vbNewLine & _
"Cancel:" & vbTab & (lngChoosen = msoBalloonButtonCancel)
End Sub

Greeting,

Wouter

"jeffP" wrote in message ...
Hi all,
I made a new balloon and I want to test the answer of the
msobuttonsetYesNoCancel
As you may know no matter what button is selected it returns 5. Or if
using
msobuttonsetYesNo then the return is 4. Or AbortRetryIgnore is a constant
10.
The object browser tells me they are assigned these constant values but I
don't get it. I'm sure the buttons can be tested,because otherwise there
would be no need for more than one button.
I want to test the buttons just like vbyes from a msgbox but obviously I'm
lost.

Any help and explanations are always appreciated.


Wouter[_2_]

Assistant.NewBalloon test
 
Hi Jeff,

I worked out this:

Sub MyBalloon()
Dim blnMy As Balloon
Dim lngChoosen As Long

Set blnMy = Assistant.NewBalloon
With blnMy
.BalloonType = msoBalloonTypeBullets
.Icon = msoIconTip
.Button = msoButtonSetOkCancel
.Heading = "Tips voor het opslaan van gegevens."
.Labels(1).Text = "Your first line of text"
.Labels(2).Text = "Your second line of text"
lngChoosen = .Show
End With
MsgBox "OK:" & vbTab & (lngChoosen = msoBalloonButtonOK) & vbNewLine & _
"Cancel:" & vbTab & (lngChoosen = msoBalloonButtonCancel)
End Sub

Good Luck

Wouter.

"jeffP" wrote in message ...
Hi all,
I made a new balloon and I want to test the answer of the
msobuttonsetYesNoCancel
As you may know no matter what button is selected it returns 5. Or if
using
msobuttonsetYesNo then the return is 4. Or AbortRetryIgnore is a constant
10.
The object browser tells me they are assigned these constant values but I
don't get it. I'm sure the buttons can be tested,because otherwise there
would be no need for more than one button.
I want to test the buttons just like vbyes from a msgbox but obviously I'm
lost.

Any help and explanations are always appreciated.


jeffP

Assistant.NewBalloon test
 
Wouter,
This worked terrifically . Thanks.
I have developed a problem though. I was fooling ' .Mode =
msoModeAutoDownand '.Mode = msoModeModeless
'.Callback = "macro1"
NOW I'm stuck w/ this balloon. Each time I open the assistant, whether my
NewBalloon or F1 first I get the newballoon and then the oldballoon.
I deleted the sub, closed the workbook, still......
Any help would be appreciated.

--
jeffP


"Wouter" wrote in message
om...
Hi Jeff,

I worked out this:

Sub MyBalloon()
Dim blnMy As Balloon
Dim lngChoosen As Long

Set blnMy = Assistant.NewBalloon
With blnMy
.BalloonType = msoBalloonTypeBullets
.Icon = msoIconTip
.Button = msoButtonSetOkCancel
.Heading = "Tips voor het opslaan van gegevens."
.Labels(1).Text = "Your first line of text"
.Labels(2).Text = "Your second line of text"
lngChoosen = .Show
End With
MsgBox "OK:" & vbTab & (lngChoosen = msoBalloonButtonOK) & vbNewLine &

_
"Cancel:" & vbTab & (lngChoosen = msoBalloonButtonCancel)
End Sub

Good Luck

Wouter.

"jeffP" wrote in message

...
Hi all,
I made a new balloon and I want to test the answer of the
msobuttonsetYesNoCancel
As you may know no matter what button is selected it returns 5. Or if
using
msobuttonsetYesNo then the return is 4. Or AbortRetryIgnore is a

constant
10.
The object browser tells me they are assigned these constant values but

I
don't get it. I'm sure the buttons can be tested,because otherwise there
would be no need for more than one button.
I want to test the buttons just like vbyes from a msgbox but obviously

I'm
lost.

Any help and explanations are always appreciated.





All times are GMT +1. The time now is 07:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com