Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Docking Pane
  New Posts New Posts RSS Feed - Using the docking pane activex with Excel
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Using the docking pane activex with Excel

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


Joined: 13 April 2007
Location: Germany
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Armin Quote  Post ReplyReply Direct Link To This Post Topic: Using the docking pane activex with Excel
    Posted: 13 April 2007 at 6:11am
Dear All,
 
has anybody ever tried to link the Docking Pane ActiveX as a docked window into the Excel desktop by using VBA?
 
I am using the trial version of Xtreme SuitePro and don't have much experience yet with these tools.
 
Any hint of how to achieve it is highly appreciated.
 
Thanks in advance
Armin
 
Back to Top
Armin View Drop Down
Newbie
Newbie


Joined: 13 April 2007
Location: Germany
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Armin Quote  Post ReplyReply Direct Link To This Post Posted: 13 April 2007 at 10:55am
Dear All,
 
regarding my previous request, please let me specify what I want to achieve:
 
You may get an idea of what I mean by looking at this: http://www.ablebits.com/excel-worksheets-manager-addins/index.php
 
This add-in is provided by a russian company. It was programmed using Delphi and works with Excel 2000 onwards. Unfortunately they do not provide this technique to others.
 
I therefore tried to find a solution on my own and thought that the Docking Pane component would be a good starting point.
 
In the Excel VBE I made a reference to the Xtreme Docking Pane Control (->Tools -> References ...) and typed in the following code into a standard module:
 
Option Explicit
'
' Retrieve a handle to the top-level window (Parent is always the Desktop)
Private Declare Function FindWindow Lib "User32" Alias "FindWindowA" ( _
                         ByVal lpClassName As String, _
                         ByVal lpWindowName As String) As Long
'
' Retrieve a handle to the top-level window in other parents
Private Declare Function FindWindowEx Lib "User32" Alias "FindWindowExA" ( _
                         ByVal hWndParent As Long, _
                         ByVal hwndChildAfter As Long, _
                         ByVal lpClassName As String, _
                         ByVal lpWindowName As String) As Long

Sub xlDockPane()
    Dim xlAppHandle As Long
    Dim xlDeskHandle As Long
    Dim DockingPaneManager As XtremeDockingPane.DockingPane
    Dim A As XtremeDockingPane.Pane
       
    xlAppHandle = FindWindow("XLMAIN", Application.Caption)
   
    If xlAppHandle = 0 Then
        xlAppHandle = FindWindow("XLMAIN", vbNullString)
    End If
       
    ' find the Excel desktop
    xlDeskHandle = FindWindowEx(xlAppHandle, 0, "XLDESK", vbNullString)
   
    Set DockingPaneManager = New DockingPane
   
    DockingPaneManager.AttachToWindow xlDeskHandle
   
    Set A = DockingPaneManager.CreatePane(1, 400, 400, DockLeftOf, Nothing)
End Sub

Also syntactically correct, the code above doesn't work.
 
Thus, any hints  are very welcome.
 
BRGDS
Armin
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.156 seconds.