+ Reply to Thread
Results 1 to 7 of 7

speech speak with message box and a reminder every 2 minutes

  1. #1
    Forum Contributor
    Join Date
    12-10-2008
    Location
    Hong Kong
    MS-Off Ver
    Office 365 PC Version
    Posts
    204

    speech speak with message box and a reminder every 2 minutes

    Hi,

    Thanks for reading my post.

    At the end of a macro I would like to have a speech speak followed by a message box.

    If the msgbox is not acknowledged I would like the speech speak to be repeated every 2 minutes.

    I have enclosed my attempt but it is not working.

    Any help is much appreciated.

    Thanks and regards john

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Re: speech speak with message box and a reminder every 2 minutes

    The MsgBox by default is displayed Modal. That means it refuses to allow anything else to occur until it is given an answer (Yes/No buttons, Cancel, etc.).

    You can get around the Modal property by using a call to the API. This resource provides an excellent example (untested here) : http://www.tek-tips.com/faqs.cfm?fid=4699


    An alternative to the above route would be to create a UserForm that looks like a MsgBox (and provides alot more flexibility for you) and load the UserForm Modeless.

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: speech speak with message box and a reminder every 2 minutes

    The code you showed here does not compile because of your syntax in the Speak line.

    Once we fix that you have three problems to solve. First, make Repeat recursive so it speaks the line then reschedules itself, rather than having the caller do that. Second, MsgBox is a modal dialog box. When the message box is show, no code will run. You have to create a UserForm that is modeless. When the user clicks OK, the userform cancels the timer. Third, you have to have a line of code to cancel the next scheduled reminder.

    I have attached an example.
    Attached Files Attached Files
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Forum Contributor
    Join Date
    12-10-2008
    Location
    Hong Kong
    MS-Off Ver
    Office 365 PC Version
    Posts
    204

    Re: speech speak with message box and a reminder every 2 minutes

    Thanks for your responses.

    I will review and revert.

    Regards john

  5. #5
    Forum Contributor
    Join Date
    12-10-2008
    Location
    Hong Kong
    MS-Off Ver
    Office 365 PC Version
    Posts
    204

    Re: speech speak with message box and a reminder every 2 minutes

    Hi,

    I reviewed the 3 subs.

    You correctly stated that the solution lies in a user form message box as a message box locks the code until their is a response.

    The only change I made was putting the call sub repeat after the user form message box.

    Really appreciate your response, thank you very much.

    Kindest regards john

  6. #6
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    speaky stuff with message box, UserForm reminder in 2 minutes and better Noize from Slade

    Hi
    Just a minor addition here.. I had not seen the Application.Speech Method before…
    I had been given a “Speech Application Programming Interface” thingy in a Thread. ( I do not know if it is related somehow to the Application.Speech).
    It is never a bad idea in programming to have an alternative Method, IMO, so here is the two Methods together just for future reference.
    Please Login or Register  to view this content.
    Alan
    Last edited by Doc.AElstein; 01-14-2018 at 03:26 AM.

  7. #7
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    “Non Modal Message Box and speak to recur until user acknowledges Message Box” API stuff

    Hi
    Here is a possible additional solution to this Thread.
    My start point was a solution based on the suggestion in Post #2, the “non Modal MsgBox”
    I was interested in learning this possibility and in doing so tried to achieve a solution to this Thread.
    Unfortunately it did not work. The stumbling block remains that the code ( and most other things in the Excel worksheet) will “wait” until the message box is closed.

    However in the course of the experimenting I came across a solution that works involving a “API call” to what appears the most fundamental message box standard Windows code.

    The solution is not as good as the full complete UserForm solution already given in Post #3
    It still does not let much more go on whilst the Msgbox is open . But it achieves a recurring message box and spoken message which only stops when the User closes the message box.

    Explanation of the general idea and code development is here:
    https://www.excelforum.com/developme...ml#post4822070
    The final code is here:
    https://www.excelforum.com/developme...ml#post4822413
    Last edited by Doc.AElstein; 01-16-2018 at 05:11 PM.
    '_- Google first, like this _ site:ExcelForum.com Gamut
    Use Code Tags: Highlight code; click on the # icon above,
    Post screenshots COPYABLE to a Spredsheet; NOT IMAGES PLEASE
    http://www.excelforum.com/the-water-...ml#post4109080
    https://app.box.com/s/gjpa8mk8ko4vkwcke3ig2w8z2wkfvrtv
    http://excelmatters.com/excel-forums/ ( Scrolll down to bottom )

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Speak - Speech - Speak numbers individually
    By BDD2015 in forum Excel General
    Replies: 8
    Last Post: 03-23-2017, 08:32 PM
  2. Replies: 1
    Last Post: 03-16-2016, 11:09 AM
  3. [SOLVED] How to make XL.Speech.Speak talk in a male voice
    By DPWM in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-03-2013, 04:43 PM
  4. [SOLVED] How to pop up a warning message before any Excel automatic update link reminder message
    By billj in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2013, 10:41 AM
  5. Speech Object and Speak Method
    By DanBlum in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-12-2011, 10:53 PM
  6. VBA Automated Reminder Message based on Date
    By Carl Thompson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-02-2010, 09:11 AM
  7. [SOLVED] can i have a pop up reminder message when i open a workbook?
    By j jones in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 11-16-2005, 04:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1