Print Page | Close Window

Using the docking pane activex with Excel

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=6857
Printed Date: 27 September 2024 at 10:50am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Using the docking pane activex with Excel
Posted By: Armin
Subject: Using the docking pane activex with Excel
Date 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
 



Replies:
Posted By: Armin
Date 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



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