469,313 Members | 2,340 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,313 developers. It's quick & easy.

Runtime error 91

Ike
Anyone knows what cuases this under 6.0 ? -Ike
Jul 17 '05 #1
1 73993
According to the MSDN library...
Error 91: Object variable or With block variable not set
---
There are two steps to creating an object variable. First you must declare
the object variable. Then you must assign a valid reference to the object
variable using the Set statement. Similarly, a With...End With block must be
initialized by executing the With statement entry point. This error has the
following causes and solutions:

You attempted to use an object variable that isn't yet referencing a valid
object.
Specify or respecify a reference for the object variable. For example, if
the Set statement is omitted in the following code, an error would be
generated on the reference to MyObject:

Dim MyObject As Object ' Create object variable.
Set MyObject = Sheets(1) ' Create valid object reference.
MyCount = MyObject.Count ' Assign Count value to MyCount.

You attempted to use an object variable that has been set to Nothing.
Set MyObject = Nothing ' Release the object.
MyCount = MyObject.Count ' Make a reference to a released object.

Respecify a reference for the object variable. For example, use a new Set
statement to set a new reference to the object.

The object is a valid object, but it wasn't set because the object library
in which it is described hasn't been selected in the References dialog box.
Select the object library in the Add References dialog box.

The target of a GoTo statement is inside a With block.
Don't jump into a With block. Make sure the block is initialized by
executing the With statement entry point.

You specified a line inside a With block when you chose the Set Next
Statement command.
The With block must be initialized by executing the With statement.

"Ike" <rx*@hotmail.com> wrote in message
news:YX*****************@newsread2.news.atl.earthl ink.net...
Anyone knows what cuases this under 6.0 ? -Ike

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Bob Bamberg | last post: by
5 posts views Thread by Nathan Bloom | last post: by
2 posts views Thread by Paul | last post: by
12 posts views Thread by Markus Ewald | last post: by
reply views Thread by zfraile | last post: by
reply views Thread by Yelena Varshal via AccessMonster.com | last post: by
7 posts views Thread by Norman Diamond | last post: by
3 posts views Thread by Jim Armstrong | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.