Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2008 member not found exception

$
0
0
in excel addin i have a form chartdetails :

Code:

Public Class ChartDetails
    Private myChart As Excel.Chart
    Private myChartQueryTable As Excel.QueryTable

    Public Sub New(ByRef chart As Excel.Chart, ByRef qt As Excel.QueryTable)
        InitializeComponent()
        myChart = chart
        myChartQueryTable = qt
    End Sub

....
end class


i try to open this form using ribbon button this way:


Code:


Private Sub btnChartDetails_Click(ByVal sender As System.Object, ByVal e As Microsoft.Office.Tools.Ribbon.RibbonControlEventArgs) Handles btnChartDetails.Click


        Dim sh As Excel.Worksheet = Globals.ThisAddIn.Application.ActiveSheet
        Dim qt As Excel.QueryTable = sh.QueryTables(1)
        MsgBox(qt.Name)  'test to ensure query table exists
        Dim chd As New ChartDetails(sh.ChartObjects(1).chart, qt) 'this line throws error
        chd.Show()

    End Sub

in the line below i have exception HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))
Code:

Dim chd As New ChartDetails(sh.ChartObjects(1).chart, qt) 'this line throws error
i use vs2008 and excel 2007.
any ideas what's wrong (i guess it's something with "qt" variable) ?

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>