Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Docking Pane
  New Posts New Posts RSS Feed - Microsoft Excel and Docking Panes - BUG!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Microsoft Excel and Docking Panes - BUG!

 Post Reply Post Reply
Author
Message
Milkman View Drop Down
Newbie
Newbie


Joined: 16 September 2005
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote Milkman Quote  Post ReplyReply Direct Link To This Post Topic: Microsoft Excel and Docking Panes - BUG!
    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. 

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 03 February 2006 at 2:24pm
You could always do this:


Dim TempPane As XtremeDockingPane.Pane


to remove any ambiguity(sp?)
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.111 seconds.