Hello all,
I've got five subroutines which can be run separately, and include a message box when an import is completed.
I also have one button which calls the five subroutines, to import all data at once. However, when I run this, I get the message box from each subroutine, which holds the total import progress.
I've found below statement on http://stackoverflow.com/questions/13635599/suppress-msgbox-from-another-subroutine-in-vba, however it immediately gives an error on the red marked line.
The error is "Compile Error: Expected: Expression"
I'm lacking experience to solve this. Can someone please help me with this? Thanking in advance.
I've got five subroutines which can be run separately, and include a message box when an import is completed.
I also have one button which calls the five subroutines, to import all data at once. However, when I run this, I get the message box from each subroutine, which holds the total import progress.
I've found below statement on http://stackoverflow.com/questions/13635599/suppress-msgbox-from-another-subroutine-in-vba, however it immediately gives an error on the red marked line.
Code:
If ShowMessages = True Then 'The = True part is important here - see below.
[COLOR="Red"]ShowMessages is a Variant type[/COLOR]
'The original statement that calls the msgBox
MsgBox "CP201 Import completed", vbInformation, "Import completed"
End If
The error is "Compile Error: Expected: Expression"
I'm lacking experience to solve this. Can someone please help me with this? Thanking in advance.