ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   A message without the box? (https://www.excelbanter.com/excel-programming/397144-message-without-box.html)

Claus Højlund[_2_]

A message without the box?
 
Is it possible to have a MsgBox without OK or cancel, simply telling what is
going on? I want to use it with a macro that takes a while, so for the user
it would be nice to know that everything is ok and the machine is working
hard and so on. I can't find such a VBA command. Can anyone help?

JMB

A message without the box?
 
You could put messages into the status bar w/o interrupting code execution
Application.StatusBar = "Sit back and relax"

To reset it when your done:
Application.StatusBar = False


"Claus Højlund" wrote:

Is it possible to have a MsgBox without OK or cancel, simply telling what is
going on? I want to use it with a macro that takes a while, so for the user
it would be nice to know that everything is ok and the machine is working
hard and so on. I can't find such a VBA command. Can anyone help?


JLGWhiz

A message without the box?
 
I saw some discussion on this the other day and one simple method was to
create a message on a separate sheet (one not used in your main program) and
put that sheet on screen until the code reaches a certain point, then put the
appropriate worksheet back on screen. See the example:

Sub x()
'Start program
'Change to screen with message telling user that processing continues
'run the main body of code
'Chane to screen showing results of processing
'Close program
End Sub

I have not tried it, but it seems simple enough.

"Claus Højlund" wrote:

Is it possible to have a MsgBox without OK or cancel, simply telling what is
going on? I want to use it with a macro that takes a while, so for the user
it would be nice to know that everything is ok and the machine is working
hard and so on. I can't find such a VBA command. Can anyone help?


Steve Yandl

A message without the box?
 
Here is one option.

____________________________________

On Error Resume Next
Set objExpl = CreateObject("InternetExplorer.Application")
With objExpl
.Navigate "about:blank"
.Toolbar = 0
.StatusBar = 0
.Width = 400
.Height = 100
.Visible = 1
.Document.Title = "Status"
.Document.Body.InnerHTML = "Be patient, subroutine may take a few
minutes"
End With

' Run some code
'For testing, you can skip the two lines below and manually quit IE.

objExpl.Quit
Set objExpl = Nothing
_____________________________________

Steve



"Claus Højlund" wrote in message
...
Is it possible to have a MsgBox without OK or cancel, simply telling what
is
going on? I want to use it with a macro that takes a while, so for the
user
it would be nice to know that everything is ok and the machine is working
hard and so on. I can't find such a VBA command. Can anyone help?




Claus Højlund[_2_]

A message without the box?
 
Hi JMB
The code works fine. The message is not that big, so I think a lot of my
students would miss it. But thanks a lot for your proposal.
CLaus

"JMB" wrote:

You could put messages into the status bar w/o interrupting code execution
Application.StatusBar = "Sit back and relax"

To reset it when your done:
Application.StatusBar = False


"Claus Højlund" wrote:

Is it possible to have a MsgBox without OK or cancel, simply telling what is
going on? I want to use it with a macro that takes a while, so for the user
it would be nice to know that everything is ok and the machine is working
hard and so on. I can't find such a VBA command. Can anyone help?


Claus Højlund[_2_]

A message without the box?
 
Thanks a lot. Just what I was looking for. I had to add this line:
Dim objExpl As Object
But now it works fine.
Again thanks a lot
Claus

"Steve Yandl" wrote:

Here is one option.

____________________________________

On Error Resume Next
Set objExpl = CreateObject("InternetExplorer.Application")
With objExpl
.Navigate "about:blank"
.Toolbar = 0
.StatusBar = 0
.Width = 400
.Height = 100
.Visible = 1
.Document.Title = "Status"
.Document.Body.InnerHTML = "Be patient, subroutine may take a few
minutes"
End With

' Run some code
'For testing, you can skip the two lines below and manually quit IE.

objExpl.Quit
Set objExpl = Nothing
_____________________________________

Steve



"Claus Højlund" wrote in message
...
Is it possible to have a MsgBox without OK or cancel, simply telling what
is
going on? I want to use it with a macro that takes a while, so for the
user
it would be nice to know that everything is ok and the machine is working
hard and so on. I can't find such a VBA command. Can anyone help?





Steve Yandl

A message without the box?
 
You're welcome.

The one time I used this myself, I had the InnerHTML text change at
different points during code execution and that worked just fine.

Steve



"Claus Højlund" wrote in message
...
Thanks a lot. Just what I was looking for. I had to add this line:
Dim objExpl As Object
But now it works fine.
Again thanks a lot
Claus

"Steve Yandl" wrote:

Here is one option.

____________________________________

On Error Resume Next
Set objExpl = CreateObject("InternetExplorer.Application")
With objExpl
.Navigate "about:blank"
.Toolbar = 0
.StatusBar = 0
.Width = 400
.Height = 100
.Visible = 1
.Document.Title = "Status"
.Document.Body.InnerHTML = "Be patient, subroutine may take a few
minutes"
End With

' Run some code
'For testing, you can skip the two lines below and manually quit IE.

objExpl.Quit
Set objExpl = Nothing
_____________________________________

Steve



"Claus Højlund" wrote in message
...
Is it possible to have a MsgBox without OK or cancel, simply telling
what
is
going on? I want to use it with a macro that takes a while, so for the
user
it would be nice to know that everything is ok and the machine is
working
hard and so on. I can't find such a VBA command. Can anyone help?








All times are GMT +1. The time now is 04:14 PM.

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