asynchron querytable refreshing

M

marcell

dear all, my problem is the following:
i'm developping an excel 2007 managed addin but this code segment doesn't
work in an asynchron way ( copied from ThisAddIn class ) :

Dim i_sheet As Worksheet = Me.Application.ActiveWorkbook.ActiveSheet

Try
Dim i_cstring As String = "OLEDB;" &
_editor.cb_sources.ComboBox.SelectedValue
_ActiveQueryTable = i_sheet.QueryTables.Add(i_cstring,
i_sheet.Range("A1"), p_commandText)
_ActiveQueryTable.CommandType = XlCmdType.xlCmdSql
_ActiveQueryTable.BackgroundQuery = True
_ActiveQueryTable.Refresh()

Catch ex As Exception
MsgBox(ex.Message)
End Try

it works fine but the application (excel) doesn't remain responsive, have to
wait till the db sends back the resultset. Could somebody help me?
thanks in advance,
m
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top