Discussion:
VB6 AND OFFICE 2007 CUSTOM TASK PANES
(too old to reply)
ctorres@dcf.pemex.com
2007-11-13 00:46:01 UTC
Permalink
Hi,

Two years ago, I developed a Microsoft Office solution using Visual Basic 6
(one COM-addin and several dll’s) and one Excel-VBA/addin. The original
solution works well with Excel 2003 and previous versions.

Currently, my company is migrating to Office 2007 and I want take advantage
of new Office’s ribbon and custom task panes.

Firstly, I tried to upgrade the solution, using Visual Basic 2005 and Visual
Studio Tools for Office SE. Unfortunately; at the end of the development I
found that the deployment process implies cover so many prerequisites and it
was so complicated that I finally decided go back to the original solution
developed in Visual Basic 6.

Manage Office 2007’s ribbon is not a problem for VB6. For the Custom Task
Pane contents, I built a UserControl named "BUcp6.ctrlBUcp6". This
UserControl works well if I put it inside a windows form. However, when I try
to put it into the task pane, I get a runtime error ‘-2147467259 (80004005)’
Unable to create specified Activex control.

Here is the code:

Line 100 arises the error.

'Called when the addin loads up, to provide a custom task pane factory.
Private Sub ICustomTaskPaneConsumer_CTPFactoryAvailable(ByVal CTPFactoryInst
As Office.ICTPFactory)
' The CLSID or ProgID of a Microsoft ActiveX® object
100: Set moCTP = CTPFactoryInst.CreateCTP("BUcp6.ctrlBUcp6", "BUcp6")
Set moBU = moCTP.ContentControl
End Sub

Even thought, I found some information at
http://support.microsoft.com/kb/318519 , the problem remains.

I really appreciate any suggestion.

Carlos Torres
Mexico City
"Jon Lewis" <jon.lewis@btinternet.com>
2007-12-16 23:36:47 UTC
Permalink
The following works for me:

Option Explicit
Implements IDTExtensibility2
Implements ICustomTaskPaneConsumer
Public WithEvents ssCTP As CustomTaskPane

Private Sub ICustomTaskPaneConsumer_CTPFactoryAvailable(ByVal CTPFactoryInst
As Office.ICTPFactory)
Set ssCTP = CTPFactoryInst.CreateCTP("SSCRMctpActiveX.ucCTP", "Title")
ssCTP.DockPosition = msoCTPDockPositionLeft
ssCTP.DockPositionRestrict = msoCTPDockPositionRestrictNoChange

'Where "SSCRMctpActiveX.ucCTP" is the user control

Does this help?

Jon
Post by ***@dcf.pemex.com
Hi,
Two years ago, I developed a Microsoft Office solution using Visual Basic 6
(one COM-addin and several dll’s) and one Excel-VBA/addin. The original
solution works well with Excel 2003 and previous versions.
Currently, my company is migrating to Office 2007 and I want take advantage
of new Office’s ribbon and custom task panes.
Firstly, I tried to upgrade the solution, using Visual Basic 2005 and Visual
Studio Tools for Office SE. Unfortunately; at the end of the development I
found that the deployment process implies cover so many prerequisites and it
was so complicated that I finally decided go back to the original solution
developed in Visual Basic 6.
Manage Office 2007’s ribbon is not a problem for VB6. For the Custom Task
Pane contents, I built a UserControl named "BUcp6.ctrlBUcp6". This
UserControl works well if I put it inside a windows form. However, when I try
to put it into the task pane, I get a runtime error ‘-2147467259 (80004005)’
Unable to create specified Activex control.
Line 100 arises the error.
'Called when the addin loads up, to provide a custom task pane factory.
Private Sub ICustomTaskPaneConsumer_CTPFactoryAvailable(ByVal
CTPFactoryInst
As Office.ICTPFactory)
' The CLSID or ProgID of a Microsoft ActiveX® object
100: Set moCTP = CTPFactoryInst.CreateCTP("BUcp6.ctrlBUcp6", "BUcp6")
Set moBU = moCTP.ContentControl
End Sub
Even thought, I found some information at
http://support.microsoft.com/kb/318519 , the problem remains.
I really appreciate any suggestion.
Carlos Torres
Mexico City
ctorres@dcf.pemex.com
2007-12-17 17:15:01 UTC
Permalink
Hi Jon,

It looks exactly like my own code. However, my project still showing the
same message error.
Did you have any special consideration to build your OCX custom control? I
think that the problem could be in my OCX user control. However, if I put the
user control inside a windows form, it works fine.

Carlos.
Post by "Jon Lewis" <***@btinternet.com>
Option Explicit
Implements IDTExtensibility2
Implements ICustomTaskPaneConsumer
Public WithEvents ssCTP As CustomTaskPane
Private Sub ICustomTaskPaneConsumer_CTPFactoryAvailable(ByVal CTPFactoryInst
As Office.ICTPFactory)
Set ssCTP = CTPFactoryInst.CreateCTP("SSCRMctpActiveX.ucCTP", "Title")
ssCTP.DockPosition = msoCTPDockPositionLeft
ssCTP.DockPositionRestrict = msoCTPDockPositionRestrictNoChange
'Where "SSCRMctpActiveX.ucCTP" is the user control
Does this help?
Jon
Post by ***@dcf.pemex.com
Hi,
Two years ago, I developed a Microsoft Office solution using Visual Basic 6
(one COM-addin and several dll’s) and one Excel-VBA/addin. The original
solution works well with Excel 2003 and previous versions.
Currently, my company is migrating to Office 2007 and I want take advantage
of new Office’s ribbon and custom task panes.
Firstly, I tried to upgrade the solution, using Visual Basic 2005 and Visual
Studio Tools for Office SE. Unfortunately; at the end of the development I
found that the deployment process implies cover so many prerequisites and it
was so complicated that I finally decided go back to the original solution
developed in Visual Basic 6.
Manage Office 2007’s ribbon is not a problem for VB6. For the Custom Task
Pane contents, I built a UserControl named "BUcp6.ctrlBUcp6". This
UserControl works well if I put it inside a windows form. However, when I try
to put it into the task pane, I get a runtime error ‘-2147467259 (80004005)’
Unable to create specified Activex control.
Line 100 arises the error.
'Called when the addin loads up, to provide a custom task pane factory.
Private Sub ICustomTaskPaneConsumer_CTPFactoryAvailable(ByVal CTPFactoryInst
As Office.ICTPFactory)
' The CLSID or ProgID of a Microsoft ActiveX® object
100: Set moCTP = CTPFactoryInst.CreateCTP("BUcp6.ctrlBUcp6", "BUcp6")
Set moBU = moCTP.ContentControl
End Sub
Even thought, I found some information at
http://support.microsoft.com/kb/318519 , the problem remains.
I really appreciate any suggestion.
Carlos Torres
Mexico City
Loading...