ADXKeyFilter Event Handle does not raise. Office 2003/2007/2010

Add-in Express™ Support Service
That's what is more important than anything else

ADXKeyFilter Event Handle does not raise. Office 2003/2007/2010
 
Jordan Blaydes




Posts: 37
Joined: 2009-02-08
Hi,

This is related to a previous post from March of this year.
http://www.add-in-express.com/forum/read.php?a&FID=1&TID=6975&MID=34832

I have finally been able to upgrade to the latest version of Add-in-express for my project. Now that I have, I have been unable to get the Form event ADXKeyFilter to fire, regardless of the Office version. I previously reported that it was intermittent on Excel 2003 only, but now this happens on all Excel versions.

I have a form as part of an ADXExcelTaskPane collection. The form inherits from AddInExpress.XL.ADXExcelTaskPane. The form is embedded on the right side of the screen and allows users to manipulate excel formulas as a companion to our product.

I use the following code in the form:



Public Sub FormulaEditor_ADXKeyFilter(ByVal sender As Object, ByVal e As AddinExpress.XL.ADXKeyFilterEventArgs) Handles Me.ADXKeyFilter

        'Did user press F4,F5, or F6? If so, let's go absolute the cell value

        Dim MyHostApp As AddinModule = AddinExpress.MSO.ADXAddinModule.CurrentInstance

        If e.KeyCode.ToString = "F4" Then
            'Absolute
            MyHostApp.SendMessage(61677, 61677, 61677)

            'This command only sends a message within the form and not to the general add-in
            'Me.ADXPostMessage(61677, 61677)

        ElseIf e.KeyCode.ToString = "F5" Then
            'Column
            MyHostApp.SendMessage(61678, 61677, 61677)
        ElseIf e.KeyCode.ToString = "F6" Then
            'Row
            MyHostApp.SendMessage(61679, 61677, 61677)
        End If
    End Sub


I understand that unless the cursor is on the form, the ADXKeyFilter will not raise. A use must have focus on my form and press the F4 key. However, when the user does this, the normal Excel shortcuts seem to be executing, which, in Add-In-Express 2008, this was not the case.
The described action should raise the ADXKeyFilter event which will raise the OnSendMessage event in the AddInModule. My AddInModule OnSendMessage code:


Private Sub AddinModule_OnSendMessage(ByVal sender As Object, ByVal e As AddinExpress.MSO.ADXSendMessageEventArgs) Handles Me.OnSendMessage
        If e.Message = 61677 And e.WParam = 61677 And e.LParam = 61677 Then
            'User wants to get the absolute value of the cell
            'Call refresh me again
            Dim strAbsolute As String
            strAbsolute = "Absolute"
            RefreshPane(strAbsolute)
        End If
        If e.Message = 61678 And e.WParam = 61677 And e.LParam = 61677 Then
            'User wants to get the absolute column value of the cell
            'Call refresh me again
            Dim strAbsolute As String
            strAbsolute = "Column"
            RefreshPane(strAbsolute)
        End If
        If e.Message = 61679 And e.WParam = 61677 And e.LParam = 61677 Then
            'User wants to get the absolute row value of the cell
            'Call refresh me again
            Dim strAbsolute As String
            strAbsolute = "Row"
            RefreshPane(strAbsolute)
        End If

        If e.Message = 9870 And e.WParam = 1 And e.LParam = 1 Then
            'User just commited a change to the formula editor, security should let this pass
            'when the OnSheetChange event is fired.
            ExcelAddinModule1.bCommitChange = True
        End If
    End Sub
Posted 16 Nov, 2010 13:21:44 Top
Jordan Blaydes




Posts: 37
Joined: 2009-02-08
Additional Information

Microsoft Visual Studio 2008
Version 9.0.30729.4462 QFE
Microsoft .NET Framework
Version 3.5 SP1

Installed Edition: Professional

Microsoft Visual Basic 2008 91605-270-7963791-60958
Microsoft Visual Basic 2008

Microsoft Visual C# 2008 91605-270-7963791-60958
Microsoft Visual C# 2008

Microsoft Visual C++ 2008 91605-270-7963791-60958
Microsoft Visual C++ 2008

Microsoft Visual Studio 2008 Tools for Office 91605-270-7963791-60958
Microsoft Visual Studio 2008 Tools for Office

Microsoft Visual Studio Tools for Applications 2.0 91605-270-7963791-60958
Microsoft Visual Studio Tools for Applications 2.0

Add-in Express?Â?Ô?? 2010 for Microsoft Office and .NET v6.2.3049
Add-in Express?Â?Ô?? 2010 for Microsoft Office and .NET. For more information about Add-in Express?Â?Ô??, see the following website: http://www.add-in-express.com. Add-in Express?Â?Ô?? 2010 for Microsoft Office and .NET, Copyright © Add-in Express. All rights reserved.

Crystal Reports AAJ60-G0MSA4K-68000CF
Crystal Reports Basic for Visual Studio 2008
Posted 16 Nov, 2010 13:25:01 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hi Jordan,

In our tests, e.KeyCode.ToString = "F4" is true; in other words, your code should work. Try to debug your code.


Andrei Smolin
Add-in Express Team Leader
Posted 17 Nov, 2010 07:19:55 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hi Jordan,

You forgot to set e.Action = AddinExpress.XL.ADXKeyFilterAction.SendToTaskPane.


Andrei Smolin
Add-in Express Team Leader
Posted 17 Nov, 2010 07:48:59 Top
Jordan Blaydes




Posts: 37
Joined: 2009-02-08
If I add the line e.Action = AddinExpress.XL.ADXKeyFilterAction.SendToTaskPane to my

Public Sub FormulaEditor_ADXKeyFilter(ByVal sender As Object, ByVal e As AddinExpress.XL.ADXKeyFilterEventArgs) Handles Me.ADXKeyFilter


it makes no difference because the event handler (Handles Me.ADXKeyFilter) is never raised.

The event has to be raised for any code in the handler to have an effect.

I went back to Add-in-Express 2008 to make sure this code works. I have a new COM add-in in ADX 2008 and ADX 2010, and 2008 version works and 2010 version does not, both with the same code, so something has changed in Add-in-express 2010 that breaks this code. I could not test the 2008 version with Office 2010 since it is not supported, but users of our product compiled with ADX 2010 have reported the issue on all versions of Office.
Posted 17 Nov, 2010 13:50:28 Top
Jordan Blaydes




Posts: 37
Joined: 2009-02-08
My ADX 2008 Environment where the code works.

Microsoft Visual Studio 2008
Version 9.0.30729.1 SP
Microsoft .NET Framework
Version 3.5 SP1

Installed Edition: Professional

Microsoft Visual Basic 2008
Microsoft Visual Basic 2008

Microsoft Visual C# 2008 Microsoft Visual C# 2008

Microsoft Visual C++ 2008
Microsoft Visual C++ 2008

Microsoft Visual Studio 2008 Tools for Office
Microsoft Visual Studio 2008 Tools for Office

Microsoft Visual Web Developer 2008
Microsoft Visual Web Developer 2008

Add-in Express?Â?Ô?? 2008 for .NET v4.4.1913
Add-in Express?Â?Ô?? 2008 for .NET. For more information about Add-in Express?Â?Ô??, see the following website: http://www.add-in-express.com. Add-in Express?Â?Ô?? 2008 for .NET, Copyright © Add-in Express. All rights reserved.

Crystal Reports Basic for Visual Studio 2008
Posted 17 Nov, 2010 13:55:50 Top
Eugene Astafiev


Guest


Hi Jordan,

Add-in Express?Â?Ô?? 2010 for Microsoft Office and .NET v6.2.3049


I have noticed that you use an old build of Add-in Express 2010. Please try to install a new http://www.add-in-express.com/downloads/adxnet.php. Also please don't forget to replace the adxloader.dll in the Loader of your project with a new one (see the Redistributables folder).

Does it help?
Posted 18 Nov, 2010 03:27:44 Top
Jordan Blaydes




Posts: 37
Joined: 2009-02-08
I think I found the issue, thanks.

I do have the latest adxloader.dll copied into my project, 6.2.3051, however, I have several environments with add-in-express installed (because side by side Office installations is discouraged):

1. Visual Studio 2008 with ADX v4.4.1913 and Office 2007 SP2
2. Visual Studio 2008 with ADX v5.3.2030 and Office 2007 SP2
3. Visual Studio 2008 with ADX v6.2.3049 and Office 2010
4. Visual Studio 2008 with ADX v6.2.3051 and Office 2010 64-bit


I did not realize that 2010 had two different releases (dated 10/11 and 10/21) until I looked closely at the version number. We have been doing our final builds on v6.2.3049 (#3 computer) but testing on v6.2.3051, and since the adxloader.dll was the correct version, I was very confused and since I downloaded them within days of each other, I didn't notice the change.

But there it is right in the release notes:
FIXED: Keyboard focus shifted to an Excel cell when typing into an Excel advanced task pane.
Posted 18 Nov, 2010 12:49:59 Top