microsoft_excel:macros:display_a_message_to_the_user
Differences
This shows you the differences between two versions of the page.
microsoft_excel:macros:display_a_message_to_the_user [2021/08/04 14:20] – created peter | microsoft_excel:macros:display_a_message_to_the_user [2021/08/04 15:12] (current) – removed peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Microsoft Excel - Macros - Display a message to the user ====== | ||
- | |||
- | <code excel> | ||
- | ' Displays a message to the user, optionally adding in how long the process ran and the queryname. | ||
- | ' Depending on the Developer Control settings it will display a System modal message. | ||
- | Function Message(msg As String, Optional elapsedtime As Single, Optional queryname As String) | ||
- | |||
- | Dim msg_to_show As String | ||
- | | ||
- | msg_to_show = msg | ||
- | | ||
- | | ||
- | If Not IsMissing(elapsedtime) And elapsedtime > 0 Then | ||
- | If msg_to_show <> "" | ||
- | msg_to_show = msg_to_show & vbCrLf & vbCrLf | ||
- | End If | ||
- | | ||
- | If Not IsMissing(queryname) Then | ||
- | msg_to_show = msg_to_show & "The query """ | ||
- | & " seconds to run." | ||
- | Else | ||
- | msg_to_show = msg_to_show & "The query took " & elapsedtime & " seconds to run." | ||
- | End If | ||
- | End If | ||
- | | ||
- | If ctrl_use_system_modal_messages = True Then | ||
- | If Not IsMissing(queryname) Then | ||
- | MessageBox &H0, msg_to_show, | ||
- | Else | ||
- | MessageBox &H0, msg_to_show, | ||
- | End If | ||
- | Else | ||
- | MsgBox msg_to_show | ||
- | End If | ||
- | | ||
- | End Function | ||
- | </ | ||
microsoft_excel/macros/display_a_message_to_the_user.1628086840.txt.gz · Last modified: 2021/08/04 14:20 by peter