Print Page | Close Window

Microsoft Excel and Docking Panes - BUG!

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=3597
Printed Date: 05 July 2024 at 5:51am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Microsoft Excel and Docking Panes - BUG!
Posted By: Milkman
Subject: Microsoft Excel and Docking Panes - BUG!
Date 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.

'Docking pane declaration using Early-Binding (DOESN'T WORK)
Dim TempPane As Pane
Set TempPane = DockingPaneManager.CreatePane(ID_TEST, 50, 50, DockLeftOf, Nothing)


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.

'Docking pane declaration using Late-Binding
Dim
TempPane As Object
Set TempPane = DockingPaneManager.CreatePane(ID_TEST, 50, 50, DockLeftOf, Nothing)


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. 




Replies:
Posted By: SuperMario
Date Posted: 03 February 2006 at 2:24pm
You could always do this:


Dim TempPane As XtremeDockingPane.Pane


to remove any ambiguity(sp?)



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net