Placement of Floating Custom Task Pane

125 views
Skip to first unread message

Richard Michaels

unread,
Sep 5, 2014, 11:23:38 AM9/5/14
to exce...@googlegroups.com
I've got a floating task pane generated from CustomTaskPaneFactory.CreateCustomTaskPane. Unfortunately, the task pane pops up in the bottom right corner of the screen with half of it off screen. Does anyone know how to place the task pane in the center of the active window? I've tried some things I found on the web:

Application.CommandBars("Task Pane").Position = CustomUI.MsoBarPosition.msoBarFloating
Application.CommandBars("Task Pane").Top = 200
Application.CommandBars("Task Pane").Left = 200

and

Dim hCtp As IntPtr = NativeMethods.FindWindowW("MsoCommandBar""Task Pane")
NativeMethods.MoveWindow(hCtp, 200, 200, 850, 625, True)

all to no avail. It's almost as if Excel-DNA has its own CommandBars collection but I doubt it. Any help appreciated.

Rick Michaels


Richard Michaels

unread,
Sep 9, 2014, 2:01:14 PM9/9/14
to exce...@googlegroups.com
Got it working using windows API calls from this StackOverflow item: http://stackoverflow.com/questions/6916402/c-excel-addin-cant-reposition-floating-custom-task-pane
Reply all
Reply to author
Forward
0 new messages