User Tools

Site Tools


microsoft_excel:macro_display_a_message_to_the_user

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
microsoft_excel:macro_display_a_message_to_the_user [2016/07/11 11:23] – created petermicrosoft_excel:macro_display_a_message_to_the_user [2021/08/04 14:20] (current) – removed peter
Line 1: Line 1:
-====== Microsoft Excel - Macro 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 <> "" Then 
-            msg_to_show = msg_to_show & vbCrLf & vbCrLf 
-        End If 
-     
-        If Not IsMissing(queryname) Then 
-            msg_to_show = msg_to_show & "The query """ & queryname & """ took " & elapsedtime _ 
-                    & " 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, wb_name & "-" & queryname, vbSystemModal 
-        Else 
-            MessageBox &H0, msg_to_show, wb_name, vbSystemModal 
-        End If 
-    Else 
-        MsgBox msg_to_show 
-    End If 
-     
-End Function 
-</code> 
  
microsoft_excel/macro_display_a_message_to_the_user.1468236197.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki