LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default message box sometimes not being called

I will be grateful for any ideas any one has on the following.

I have a long macro that when run sometimes calls the message box as below
and sometimes does not. I have tried including it in the macro code and also
tried calling it (ie having it separate) and the only way i can make it work
every time is to in effect stop the macro by putting another message box
before it such as 'msgbox "xyz" ' this has the effect of stopping the macro
and it runs every time. As you will note it is a basic message box.

Code as below


Public hols As Boolean( i actually declare this at the top with other public
declarations)
Dim Msg, Style, Title, holiday
Msg = "Was yesterday a holiday ?"
Style = vbYesNo
Title = "Holiday?"


holiday = MsgBox(Msg, Style, Title)
If holiday = vbYes Then hols = True
If holiday = vbNo Then hols = False


This then sets the hols variable to true or false.

--
with kind regards

Spike
 
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
what is this called? : < Jake Excel Worksheet Functions 1 November 28th 06 11:01 AM
What is this function called?? jPaulB Excel Discussion (Misc queries) 3 August 4th 06 08:33 PM
How can a UDF be called from a formula? GuyH Excel Worksheet Functions 0 November 17th 04 03:37 PM
Run Workbook_Open only if called Jarek[_13_] Excel Programming 1 September 17th 04 03:10 PM
Possible to know who has called a function ? Isabelle Robin Excel Programming 3 March 5th 04 12:33 AM


All times are GMT +1. The time now is 04:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"