MsgBox Syntax

  • Thread starter Thread starter scott
  • Start date Start date
S

scott

I get an error on final "MsgBox =" line. Can someone help with syntax? I
just want an "OK" button with warning sign.

Dim Msg, Style, Title
Style = vbExclamation
Title = "Warning"
Msg = "The Database import table" & _
Chr(13) & "has not been processed." & _
Chr(13) & "" & _
Chr(13) & "Please open Access and import it." & _
Chr(13) & "" & _
Chr(13) & "Then return to Excel and resume export"

MsgBox = (Msg, Style, Title)
 
Dim Msg, Style, Title
Style = vbExclamation
Title = "Warning"
Msg = "The Database import table" & _
Chr(13) & "has not been processed." & _
Chr(13) & "" & _
Chr(13) & "Please open Access and import it." & _
Chr(13) & "" & _
Chr(13) & "Then return to Excel and resume export"

MsgBox Msg, Style, Title
 
Thanks again for saving me.


Tom Ogilvy said:
Dim Msg, Style, Title
Style = vbExclamation
Title = "Warning"
Msg = "The Database import table" & _
Chr(13) & "has not been processed." & _
Chr(13) & "" & _
Chr(13) & "Please open Access and import it." & _
Chr(13) & "" & _
Chr(13) & "Then return to Excel and resume export"

MsgBox Msg, Style, Title
 
Scott

one way:

Dim sMsg As String, Style, sTitle As String
Style = vbExclamation
sTitle = "Warning"
sMsg = "The Database import table" & _
Chr(13) & "has not been processed." & _
Chr(13) & "" & _
Chr(13) & "Please open Access and import it." & _
Chr(13) & "" & _
Chr(13) & "Then return to Excel and resume export"

MsgBox sMsg, Style, sTitle

Regards

Trevor
 
Back
Top