Displaying a status message

S

Scott Arnold

How do I specify the text to be displayed in the status
area? I am executing stored procedures that retrieve data
from a SQL Server database and I would like to indicate
what data I am retrieving in a status message, rather than
having the "Connecting to datasource..." and "Getting
data..." (or whatever displays) showing in the lower left
of the Excel window.

How do I do this?
 
J

Jim Rech

Application.StatusBar = "My message"

--
Jim Rech
Excel MVP
| How do I specify the text to be displayed in the status
| area? I am executing stored procedures that retrieve data
| from a SQL Server database and I would like to indicate
| what data I am retrieving in a status message, rather than
| having the "Connecting to datasource..." and "Getting
| data..." (or whatever displays) showing in the lower left
| of the Excel window.
|
| How do I do this?
 
O

onedaywhen

| How do I specify the text to be displayed in the status
| area? I am executing stored procedures that retrieve data
| from a SQL Server database and I would like to indicate
| what data I am retrieving in a status message, rather than
| having the "Connecting to datasource..." and "Getting
| data..." (or whatever displays) showing in the lower left
| of the Excel window.

...
Application.StatusBar = "My message"

Jim Rech
Excel MVP

If you are not already doing so, consider sinking your ADO Connection
and Recordset objects in a class so you can connect/fetch
asynchronously e.g.

Option Explicit

Private WithEvents m_rs As ADODB.Recordset
Public Event FetchComplete()

Public Function FetchBegin() As Boolean
Set m_rs = New ADODB.Recordset
With m_rs
.LockType = adLockReadOnly
.CursorLocation = adUseClient ' required
.CursorType = adOpenForwardOnly
.Source = "SELECT * FROM LongTime"
.ActiveConnection = m_con
.Open , , , , adAsyncFetch Or adCmdText
End With
FetchBegin = True
End Sub

Private Sub m_rs_FetchComplete(ByVal pError As ADODB.Error, _
adStatus As ADODB.EventStatusEnum, _
ByVal pRecordset As ADODB.Recordset)
RaiseEvent FetchComplete
End Sub

--
 
Top