Sorry but I was trying to find the answer for hours but could not figure it out. I tried playing with vbNewLine and vbCrLf but could not make it to work in the function and in the function call.
How do I add a new line with the code below?
Tried this but it did not work:
checker = MessageTimeOut("Underlying raw data in the workbook has been updated." & vbNewLine & "This will close automatically.", "UPDATE RAW DATA - COMPLETED", 5)
Also tried:
checker = MessageTimeOut("Underlying raw data in the workbook has been updated." & vbCrLf & "This will close automatically.", "UPDATE RAW DATA - COMPLETED", 5)
I want the "This will close automatically." shown in a new line.
Function MessageTimeOut(str_message As String, str_title As String, int_seconds As Integer) As Boolean
Dim Shell
Set Shell = CreateObject("WScript.Shell")
Shell.Run "mshta.exe vbscript:close(CreateObject(""WScript.shell"").Popup(""" & str_message & """," & int_seconds & ",""" & str_title & """))"
MessageTimeOut = True
End Function
Sub Some_Sub()
' some lengthy code....
Dim checker As Boolean
checker = MessageTimeOut("Underlying raw data in the workbook has been updated. This will close automatically.", "UPDATE RAW DATA - COMPLETED", 5)