Microsoft Visual Basic error: "expected: end of statement" - TechRepublic
Question
March 4, 2010 at 08:45 AM
mobil-d

Microsoft Visual Basic error: “expected: end of statement”

by mobil-d . Updated 16 years, 4 months ago

I’m experiencing an issue with macros in Word 2007. I copied the following code verbatim from MSDN (URL at bottom) into Microsoft Visual Basic: –

Public Function GetScreenTip(ByVal control As IRibbonControl) As String
Return “This is a screen tip for the menu.”
End Function

However, I get a compiler error, “expected: end of statement”, referring to the return statement. Now I’m no expert programmer, but from what I understand, it’s pretty well commonplace for a function to return a value. I don’t have much of a clue when it comes to VB though. Could anyone help me out?

http://msdn.microsoft.com/en-us/library/bb462634.aspx

This discussion is locked

All Comments