ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Displaying a status message (https://www.excelbanter.com/excel-programming/297945-displaying-status-message.html)

Scott Arnold

Displaying a status message
 
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?

Jim Rech

Displaying a status message
 
Application.StatusBar = "My message"

--
Jim Rech
Excel MVP
"Scott Arnold" wrote in message
...
| 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?



onedaywhen

Displaying a status message
 
"Scott Arnold" wrote ...
| 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.


"Jim Rech" wrote ...

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

--


All times are GMT +1. The time now is 06:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com