View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default why does this fail?

It works fine for me too. As Jim says, technically the button constants are
Longs, but I also don't get a problem with Integer, and I tried with 97,
2000 and XP. If you have 2003, try it with Long.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Jim Thomlinson" wrote in message
...
Don't know why it does not owrk for you. It works for me... The only thing

I
see is that msgbox returns a long not an integer. Not thgat it has ever
caused me a problem using int but as a technicallity...

Jim Thomlinson


"Gixxer_J_97" wrote:

public sub test()
dim c as integer,s1 as string, s2 as string
s1="My Message"
s2 = "My Title"
c=msgbox(s1,vbyesno,s2)
if c=vbyes then
msgbox "hi"
else
msgbox "bye"
end if
end sub

this is always displaying "bye"

why? c (just after assignment) contains 6
at the test, c is empty

what am i missing?

it works using

if msgbox(s1,vbyesno,s2)=vbyes then ....

jooc

thanks

J