Can't Set Bookmarks When Variables Defined as String (135241)



The information in this article applies to:

  • Microsoft Excel for Windows 95

This article was previously published under Q135241

SUMMARY

When you assign a variable to a bookmark as a String data type, if you are using Data Access Objects (DAO) in a Visual Basic for Applications module, the following error message will be displayed:
Not a valid bookmark.

WORKAROUND

To work around this problem, declare the variable assigned to the bookmark as a Variant data type, as in the following example:
Dim MyBookMark As Variant

Modification Type:MinorLast Reviewed:10/11/2006
Keywords:kbProgramming KB135241