ACC97: Errors in "GetObject Function" Example in HelpID: Q167590
|
If you copy the example from the "GetObject Function" Help topic in Microsoft Access 97 and paste it into a module, you may receive the following error message when you compile your code:
This article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to the "Building Applications with Microsoft Access 97" manual.Compile error:
Expected: list separator or )
This error is caused by missing commas in the Declare statement for the
SendMessage function. A comma is missing after the ByVal wMsg As Long
argument and after the ByVal wParam As Long argument for this function.
NOTE: If you insert the missing commas and try to compile your code, you
receive another error:
This error is caused by a missing apostrophe (') before the following comment:Compile error:
Syntax error
Set the object variable to reference the file you want to see.
Modify the following portions of the code in the Help example to include the two missing commas and the missing apostrophe.
Declare Function SendMessage Lib "user32" Alias _
"SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
' Set the object variable to reference the file you want to see.
Set MyXL = GetObject("c:\vb4\MYTEST.XLS")
Additional query words:
Keywords : kberrmsg kbole IntpOlea
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: August 5, 1999