robertf

VB code from a 9.3mxd not running in 10 - sort of

Discussion created by robertf on Dec 10, 2010
Latest reply on Dec 15, 2010 by robertf
some code I had written in 9.3 that is embedded in an mxd and is supposed to run when the mxd is opened does not work in 10.  It's very simple code, all it does is update a small string of text in the layout with details about the document: name, path, size, etc... 

When I open the mxd in 10 (SP1) I get the run-time error 91 'object variable or with block variable not set'. But when I go to debug the code, and hit run in the vb editor, all runs fine and the text updates as it should. 

I'm really a hack with arcobjects and I'm sure this is probably a very simple, very easy fix but it's just beyond me.  I've attached the mxd for reference.  Can anyone shed some light on this?

Rob

Attachments

Outcomes