Results 1 to 3 of 3

Thread: [RESOLVED] Msgbox

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    9

    Resolved [RESOLVED] Msgbox

    I am getting an "Expected: End of Statement error with the following code. Does anyone know why... I can't figure it out.

    VB Code:
    1. Msg1 = MsgBox("Before you start, please ensure that you know the tab and cell you wish to copy from. For example, for Maximum Roundness Deviation you want to copy from the 'E34' cell of the 'General' tab.", vbOKCancel, "Before you start", vbInformation) As VbMsgBoxResult

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Msgbox

    Remove the "As VbMsgBoxResult" from the end - you cannot tell the MsgBox function what type to return.

  3. #3
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Msgbox

    You should declare Msg1 as VbMsgBoxResult :

    VB Code:
    1. Dim Msg1 As VbMsgBoxResult
    2. Msg1 = MsgBox("Before you start, please ensure that you know the tab and cell you wish to copy from. For example, for Maximum Roundness Deviation you want to copy from the 'E34' cell of the 'General' tab.", vbOKCancel, "Before you start", vbInformation)


    Has someone helped you? Then you can Rate their helpful post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width