Microsoft Excel and Docking Panes - BUG! |
Post Reply |
Author | ||
Milkman
Newbie Joined: 16 September 2005 Status: Offline Points: 11 |
Post Options
Thanks(0)
Posted: 03 February 2006 at 2:18pm |
|
I ran across this little bug recently, while I was trying to incorporate a Microsoft Excel ActiveX automation server within my project.
If you declare a variable as a "Pane" object and you have the Microsoft Excel XX.0 Object Library as one of your References, you'll come across a nasty little run-time error 13. The example below causes the error.
Why is the error caused? Quite simply because CodeJock decided to name their objects with rather standard names (i.e. "Pane"). Microsoft Excel also has an object named "Pane". Thus when you are declaring the object in the first line, it declares as an Excel pane, and then the docking pane manager tries use that object as a CodeJock pane. How do you get around this error?? Use late-binding instead of early-binding. That means that you declare the variable as a standard object rather than a CodeJock "Pane" object.
The downside of this is that you'll loose the intellisense feature that is so handy in VB; but, at least your code will work. Something tells me that CodeJock won't be fixing this little problem anytime soon as it requires renaming their object, which will undoubtedly break any existing code. It's too bad that they didn't have the fore-thought to assign unique names to their objects. If this post helped you out, please reply. |
||
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
|
You could always do this:
to remove any ambiguity(sp?) |
||
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |