Well, one thing to be aware of is the size limits of the MsgBox method....
If you're going to programmatically fill a box like this, it may not work out if you have a large number of log types. The character limit is 1024, so if you have more characters than that it won't work and will truncate the text early. I have a method I commonly use I adapted from somewhere I don't recall:
Code:
Public Const vbStayTop = 4096
Public Function iPopUpBox(ByVal sMessage As String, Optional ByVal iSecondsToWait As Integer = 0, Optional ByVal sTitle As String = "ImportData", Optional ByVal iType As VBA.VbMsgBoxStyle = 0) As Integer
Dim wsh As Object
Dim waitOnReturn As Boolean: waitOnReturn = True
Dim windowStyle As Integer: windowStyle = 1
Set wsh = VBA.CreateObject("wScript.Shell")
iPopUpBox = wsh.PopUp(sMessage, iSecondsToWait, sTitle, iType + vbStayTop)
End Function
That will get around the character limit, and it has the iSecondsToWait property, which lets you auto-dismiss the pop up after a period of time if you want to. The equivalent to your existing MsgBox code would be:
Code:
Dim sMsg As String
sMsg = "Successfully imported n records from .log files:" & vbCrLf & vbCrLf
sMsg = sMsg & "Syslog '" & ShortSyslog1 & "':" & Chr$(9) & Chr$(9) & CntSysLog1 & vbCrLf
sMsg = sMsg & "Syslog '" & ShortSyslog2 & "':" & Chr$(9) & Chr$(9) & CntSysLog2 & vbCrLf
sMsg = sMsg & "Syslog '" & ShortSyslog3 & "':" & Chr$(9) & Chr$(9) & CntSysLog3
Debug.Print iPopUpBox(sMsg, , "Status Message", vbInformation + vbOKOnly)
If you wanted that same message to disappear after 15 seconds:
Code:
iPopUpBox sMsg, 15, "Status Message", vbInformation + vbOKOnly
I've written up something that should meet requirements. See attached.