ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   message box transient -sub by Chip Perason (https://www.excelbanter.com/excel-programming/334747-message-box-transient-sub-chip-perason.html)

R.VENKATARAMAN

message box transient -sub by Chip Perason
 
In one of my serches in googles group I found pearson's sub on having a
transient message box

quote
Dim SH As IWshRuntimeLibrary.WshShell
Dim Res As Long
Set SH = New IWshRuntimeLibrary.WshShell
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)
unquote

as suggested i have referenced in vbeditor tools references

<windows scripting host object model(ver 1.0)

and then run the above sub
But I get an error message and the sub stops at the line

<Dim SH As IWshRuntimeLibrary.WshShell

the error mesage is
<user defined type not defind

where I am doing the mistake

mine excel 2000
windows 98SE

request help
thanks regards.








Jim Cone

message box transient -sub by Chip Perason
 

Looks like you didn't get all of the post.
What you need to do is to set a reference to the
"Windows Script Host Object Model" on the
Tools | References menu in the VBE.

Jim Cone
San Francisco, USA


"R.VENKATARAMAN" wrote in message
...
In one of my serches in googles group I found pearson's sub on having a
transient message box

quote
Dim SH As IWshRuntimeLibrary.WshShell
Dim Res As Long
Set SH = New IWshRuntimeLibrary.WshShell
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)
unquote

as suggested i have referenced in vbeditor tools references
<windows scripting host object model(ver 1.0)
and then run the above sub
But I get an error message and the sub stops at the line
<Dim SH As IWshRuntimeLibrary.WshShell
the error mesage is
<user defined type not defind
where I am doing the mistake
mine excel 2000
windows 98SE
request help
thanks regards.








Gareth[_6_]

message box transient -sub by Chip Perason
 
Are you sure you have the right OCX referenced?

On my machine (XP, XL2003) it is called (exactly) "Windows Script Host
Object Model".

c:\windows\system32\wshom.ocx

Maybe it doesn't work on 98SE? Sorry I can't be of more help.

Gareth


R.VENKATARAMAN wrote:
In one of my serches in googles group I found pearson's sub on having a
transient message box

quote
Dim SH As IWshRuntimeLibrary.WshShell
Dim Res As Long
Set SH = New IWshRuntimeLibrary.WshShell
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)
unquote

as suggested i have referenced in vbeditor tools references

<windows scripting host object model(ver 1.0)

and then run the above sub
But I get an error message and the sub stops at the line

<Dim SH As IWshRuntimeLibrary.WshShell

the error mesage is
<user defined type not defind

where I am doing the mistake

mine excel 2000
windows 98SE

request help
thanks regards.








R.VENKATARAMAN

message box transient -sub by Chip Perason
 
no. in my messsage I have clearly written I have referenced the particular
refernce (see line below "unquote")


Jim Cone wrote in message
...

Looks like you didn't get all of the post.
What you need to do is to set a reference to the
"Windows Script Host Object Model" on the
Tools | References menu in the VBE.

Jim Cone
San Francisco, USA


"R.VENKATARAMAN" wrote in message
...
In one of my serches in googles group I found pearson's sub on having a
transient message box

quote
Dim SH As IWshRuntimeLibrary.WshShell
Dim Res As Long
Set SH = New IWshRuntimeLibrary.WshShell
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)
unquote

as suggested i have referenced in vbeditor tools references
<windows scripting host object model(ver 1.0)
and then run the above sub
But I get an error message and the sub stops at the line
<Dim SH As IWshRuntimeLibrary.WshShell
the error mesage is
<user defined type not defind
where I am doing the mistake
mine excel 2000
windows 98SE
request help
thanks regards.










R.VENKATARAMAN

message box transient -sub by Chip Perason
 
thanks. there is no other reference . is the problem with windows98 or excel
version excel 2000.
the file wshom.ocx is in forlder c:\windows\system(not in system32).



Gareth wrote in message
...
Are you sure you have the right OCX referenced?

On my machine (XP, XL2003) it is called (exactly) "Windows Script Host
Object Model".

c:\windows\system32\wshom.ocx

Maybe it doesn't work on 98SE? Sorry I can't be of more help.

Gareth


R.VENKATARAMAN wrote:
In one of my serches in googles group I found pearson's sub on having a
transient message box

quote
Dim SH As IWshRuntimeLibrary.WshShell
Dim Res As Long
Set SH = New IWshRuntimeLibrary.WshShell
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)
unquote

as suggested i have referenced in vbeditor tools references

<windows scripting host object model(ver 1.0)

and then run the above sub
But I get an error message and the sub stops at the line

<Dim SH As IWshRuntimeLibrary.WshShell

the error mesage is
<user defined type not defind

where I am doing the mistake

mine excel 2000
windows 98SE

request help
thanks regards.










okaizawa

message box transient -sub by Chip Perason
 
Hi,
you can find information about Popup method on the Object Browser.
(press F2 in the Visual Basic Editor)
the following works on my PC.

Sub Test1()

'Win98SE, Excel 2000
'Reference
' Library IWshRuntimeLibrary
' C:\WINDOWS\SYSTEM\WSHOM.OCX
' Windows Script Host Object Model (Ver 1.0)

Dim SH As IWshRuntimeLibrary.IWshShell_Class
Dim Res As Long
Set SH = New IWshRuntimeLibrary.IWshShell_Class
Res = SH.Popup(bstrText:="Click Me", pvarSecondsToWait:=5, _
pvarTitle:="Hello, World", pvarType:=vbOKOnly)
End Sub

Sub Test2()
Dim Res As Long
Res = CreateObject("WScript.Shell") _
.Popup("Click Me", 5, "Hello, World", 0)
End Sub

--
HTH

okaizawa


R.VENKATARAMAN wrote:
In one of my serches in googles group I found pearson's sub on having a
transient message box

quote
Dim SH As IWshRuntimeLibrary.WshShell
Dim Res As Long
Set SH = New IWshRuntimeLibrary.WshShell
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)
unquote

as suggested i have referenced in vbeditor tools references

<windows scripting host object model(ver 1.0)

and then run the above sub
But I get an error message and the sub stops at the line

<Dim SH As IWshRuntimeLibrary.WshShell

the error mesage is
<user defined type not defind

where I am doing the mistake

mine excel 2000
windows 98SE

request help
thanks regards.


Peter T

message box transient -sub by Chip Perason
 
The routine appears to work for everyone else but, like you, not in my W98 /
XL2K. The msgbox pops up but does not disappear after SecondsToWait, only if
I click out.

I set a ref to "Windows Script Host Object Model" WSHOM.OCX

I get the following intellisense after typing "res = SH.Popup("

Popup(Text as String,[SecondsToWait],[Title],[Type]) As Long

So it looks like it should work, strange it doesn't. If I don't send aType
(button), the only way to close the msgbox is with Ctrl-Alt-Del. My
WSHOM.OCX is version 5.6.0.6626. I think v5.6 is current, not v1.0.

I don't recall ever having updated my WSHOM.OCX. There's one version for W98
/ ME / NT and another for all later versions of Windows. Maybe we have the
wrong version for our OS, possibly from some poor installer. I'll try and
look into it later.

Regards,
Peter T

"R.VENKATARAMAN" wrote in message
...
In one of my serches in googles group I found pearson's sub on having a
transient message box

quote
Dim SH As IWshRuntimeLibrary.WshShell
Dim Res As Long
Set SH = New IWshRuntimeLibrary.WshShell
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)
unquote

as suggested i have referenced in vbeditor tools references

<windows scripting host object model(ver 1.0)

and then run the above sub
But I get an error message and the sub stops at the line

<Dim SH As IWshRuntimeLibrary.WshShell

the error mesage is
<user defined type not defind

where I am doing the mistake

mine excel 2000
windows 98SE

request help
thanks regards.










Peter T

message box transient -sub by Chip Perason
 
Maybe we have the wrong version for our OS, possibly from some poor
installer.


I installed the latest version WSHOM.OCX 5.6.0.8825 for W98

http://www.microsoft.com/downloads/d...8F6-249C-4A72-
BFCF-FC6AF26DC390&displaylang=en&Hash=TLJCWD

No difference, still doesn't work (ie clear the popup after SecondsToWait)

Peter T


The routine appears to work for everyone else but, like you, not in my W98

/
XL2K. The msgbox pops up but does not disappear after SecondsToWait, only

if
I click out.

I set a ref to "Windows Script Host Object Model" WSHOM.OCX

I get the following intellisense after typing "res = SH.Popup("

Popup(Text as String,[SecondsToWait],[Title],[Type]) As Long

So it looks like it should work, strange it doesn't. If I don't send aType
(button), the only way to close the msgbox is with Ctrl-Alt-Del. My
WSHOM.OCX is version 5.6.0.6626. I think v5.6 is current, not v1.0.

I don't recall ever having updated my WSHOM.OCX. There's one version for

W98
/ ME / NT and another for all later versions of Windows. Maybe we have the
wrong version for our OS, possibly from some poor installer. I'll try and
look into it later.

Regards,
Peter T

"R.VENKATARAMAN" wrote in message
...
In one of my serches in googles group I found pearson's sub on having a
transient message box

quote
Dim SH As IWshRuntimeLibrary.WshShell
Dim Res As Long
Set SH = New IWshRuntimeLibrary.WshShell
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)
unquote

as suggested i have referenced in vbeditor tools references

<windows scripting host object model(ver 1.0)

and then run the above sub
But I get an error message and the sub stops at the line

<Dim SH As IWshRuntimeLibrary.WshShell

the error mesage is
<user defined type not defind

where I am doing the mistake

mine excel 2000
windows 98SE

request help
thanks regards.












R.VENKATARAMAN

message box transient -sub by Chip Perason
 
thanks for all those who tried to help


===================
Peter T <peter_t@discussions wrote in message
...
Maybe we have the wrong version for our OS, possibly from some poor
installer.


I installed the latest version WSHOM.OCX 5.6.0.8825 for W98


http://www.microsoft.com/downloads/d...8F6-249C-4A72-
BFCF-FC6AF26DC390&displaylang=en&Hash=TLJCWD

No difference, still doesn't work (ie clear the popup after SecondsToWait)

Peter T


The routine appears to work for everyone else but, like you, not in my

W98
/
XL2K. The msgbox pops up but does not disappear after SecondsToWait,

only
if
I click out.

I set a ref to "Windows Script Host Object Model" WSHOM.OCX

I get the following intellisense after typing "res = SH.Popup("

Popup(Text as String,[SecondsToWait],[Title],[Type]) As Long

So it looks like it should work, strange it doesn't. If I don't send

aType
(button), the only way to close the msgbox is with Ctrl-Alt-Del. My
WSHOM.OCX is version 5.6.0.6626. I think v5.6 is current, not v1.0.

I don't recall ever having updated my WSHOM.OCX. There's one version for

W98
/ ME / NT and another for all later versions of Windows. Maybe we have

the
wrong version for our OS, possibly from some poor installer. I'll try

and
look into it later.

Regards,
Peter T

"R.VENKATARAMAN" wrote in message
...
In one of my serches in googles group I found pearson's sub on having

a
transient message box

quote
Dim SH As IWshRuntimeLibrary.WshShell
Dim Res As Long
Set SH = New IWshRuntimeLibrary.WshShell
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)
unquote

as suggested i have referenced in vbeditor tools references

<windows scripting host object model(ver 1.0)

and then run the above sub
But I get an error message and the sub stops at the line

<Dim SH As IWshRuntimeLibrary.WshShell

the error mesage is
<user defined type not defind

where I am doing the mistake

mine excel 2000
windows 98SE

request help
thanks regards.














Peter T

message box transient -sub by Chip Perason
 
I should have made clear there's quite a difference in the way things don't
work for us. You said -
"
But I get an error message and the sub stops at the line
<Dim SH As IWshRuntimeLibrary.WshShell
"
Unlike you I don't get an error, but it just doesn't work as expected.

Regards,
Peter T

"R.VENKATARAMAN" wrote in message
...
thanks for all those who tried to help


===================
Peter T <peter_t@discussions wrote in message
...
Maybe we have the wrong version for our OS, possibly from some poor
installer.


I installed the latest version WSHOM.OCX 5.6.0.8825 for W98



http://www.microsoft.com/downloads/d...8F6-249C-4A72-
BFCF-FC6AF26DC390&displaylang=en&Hash=TLJCWD

No difference, still doesn't work (ie clear the popup after

SecondsToWait)

Peter T


The routine appears to work for everyone else but, like you, not in my

W98
/
XL2K. The msgbox pops up but does not disappear after SecondsToWait,

only
if
I click out.

I set a ref to "Windows Script Host Object Model" WSHOM.OCX

I get the following intellisense after typing "res = SH.Popup("

Popup(Text as String,[SecondsToWait],[Title],[Type]) As Long

So it looks like it should work, strange it doesn't. If I don't send

aType
(button), the only way to close the msgbox is with Ctrl-Alt-Del. My
WSHOM.OCX is version 5.6.0.6626. I think v5.6 is current, not v1.0.

I don't recall ever having updated my WSHOM.OCX. There's one version

for
W98
/ ME / NT and another for all later versions of Windows. Maybe we have

the
wrong version for our OS, possibly from some poor installer. I'll try

and
look into it later.

Regards,
Peter T

"R.VENKATARAMAN" wrote in message
...
In one of my serches in googles group I found pearson's sub on

having
a
transient message box

quote
Dim SH As IWshRuntimeLibrary.WshShell
Dim Res As Long
Set SH = New IWshRuntimeLibrary.WshShell
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)
unquote

as suggested i have referenced in vbeditor tools references

<windows scripting host object model(ver 1.0)

and then run the above sub
But I get an error message and the sub stops at the line

<Dim SH As IWshRuntimeLibrary.WshShell

the error mesage is
<user defined type not defind

where I am doing the mistake

mine excel 2000
windows 98SE

request help
thanks regards.
















Dave Peterson

message box transient -sub by Chip Perason
 
You could also use late binding and drop the reference:

Dim SH As Object
Dim Res As Long
Set SH = CreateObject("wscript.shell")
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)



"R.VENKATARAMAN" wrote:

In one of my serches in googles group I found pearson's sub on having a
transient message box

quote
Dim SH As IWshRuntimeLibrary.WshShell
Dim Res As Long
Set SH = New IWshRuntimeLibrary.WshShell
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)
unquote

as suggested i have referenced in vbeditor tools references

<windows scripting host object model(ver 1.0)

and then run the above sub
But I get an error message and the sub stops at the line

<Dim SH As IWshRuntimeLibrary.WshShell

the error mesage is
<user defined type not defind

where I am doing the mistake

mine excel 2000
windows 98SE

request help
thanks regards.


--

Dave Peterson

R.VENKATARAMAN

message box transient -sub by Chip Perason
 
apologise for asking a dumb question. what is late binding. what should I
do.
I removed the tick from the reference list.
still sub stops at

Res=etc. etc..

error
<named argument not found
================================
Dave Peterson wrote in message
...
You could also use late binding and drop the reference:

Dim SH As Object
Dim Res As Long
Set SH = CreateObject("wscript.shell")
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)



"R.VENKATARAMAN" wrote:

In one of my serches in googles group I found pearson's sub on having a
transient message box

quote
Dim SH As IWshRuntimeLibrary.WshShell
Dim Res As Long
Set SH = New IWshRuntimeLibrary.WshShell
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)
unquote

as suggested i have referenced in vbeditor tools references

<windows scripting host object model(ver 1.0)

and then run the above sub
But I get an error message and the sub stops at the line

<Dim SH As IWshRuntimeLibrary.WshShell

the error mesage is
<user defined type not defind

where I am doing the mistake

mine excel 2000
windows 98SE

request help
thanks regards.


--

Dave Peterson




Norman Jones

message box transient -sub by Chip Perason
 
Hi Peter,

Unlike you I don't get an error, but it just doesn't work as expected


My experience replicates yours, albeit with a xl2k/winXp configuration: the
message box appears (without error) but requires manual dismissal.

---
Regards,
Norman



"Peter T" <peter_t@discussions wrote in message
...
I should have made clear there's quite a difference in the way things don't
work for us. You said -
"
But I get an error message and the sub stops at the line
<Dim SH As IWshRuntimeLibrary.WshShell
"
Unlike you I don't get an error, but it just doesn't work as expected.

Regards,
Peter T




Gareth[_6_]

message box transient -sub by Chip Perason
 
Hey Norman,

I thought that originally - but then (I don't know why) I sulked and
refused to click it away and it disappeared of its own volition after
about 40". Out of curiosity, maybe it's the same for you?

Indeed, I decided to change the SecondsToWait parameter and the results
were as follows:

Sec nn:ss
1 - 00:03
2 - 02:08
3 - 00:27
3 - 00:07
4 - 00:27
5 - 00:19

Clearly inconsistent - makes this somewhat unusable.

Thanks,
Gareth

Norman Jones wrote:
Hi Peter,


Unlike you I don't get an error, but it just doesn't work as expected



My experience replicates yours, albeit with a xl2k/winXp configuration: the
message box appears (without error) but requires manual dismissal.

---
Regards,
Norman



"Peter T" <peter_t@discussions wrote in message
...

I should have made clear there's quite a difference in the way things don't
work for us. You said -
"
But I get an error message and the sub stops at the line
<Dim SH As IWshRuntimeLibrary.WshShell
"
Unlike you I don't get an error, but it just doesn't work as expected.

Regards,
Peter T





Norman Jones

message box transient -sub by Chip Perason
 
Hi Gareth,

Out of curiosity, maybe it's the same for you?


I'm afraid not.

My attention span collapsed after 90 secs and I manually closed.

Perhaps, however, I do not have your prodigious sulking ability!

---
Regards,
Norman



"Gareth" wrote in message
...
Hey Norman,

I thought that originally - but then (I don't know why) I sulked and
refused to click it away and it disappeared of its own volition after
about 40". Out of curiosity, maybe it's the same for you?

Indeed, I decided to change the SecondsToWait parameter and the results
were as follows:

Sec nn:ss
1 - 00:03
2 - 02:08
3 - 00:27
3 - 00:07
4 - 00:27
5 - 00:19

Clearly inconsistent - makes this somewhat unusable.

Thanks,
Gareth

Norman Jones wrote:
Hi Peter,


Unlike you I don't get an error, but it just doesn't work as expected



My experience replicates yours, albeit with a xl2k/winXp configuration:
the message box appears (without error) but requires manual dismissal.

---
Regards,
Norman



"Peter T" <peter_t@discussions wrote in message
...

I should have made clear there's quite a difference in the way things
don't
work for us. You said -
"
But I get an error message and the sub stops at the line
<Dim SH As IWshRuntimeLibrary.WshShell
"
Unlike you I don't get an error, but it just doesn't work as expected.

Regards,
Peter T





Peter T

message box transient -sub by Chip Perason
 
Hi Norman,

I was anticipating coming back to this thread needing to start my reply
with -Doh...! So I'm rather glad you report similar.

Gareth's observations are interesting, but like you I don't have enough
"sulking ability" to see for myself!

No doubt there's some simple explanation, but whatever it is in the light of
our experiences it suggests the method cannot be distributed reliably, a
shame.

Dave - re your suggestion in another part of this thread:
Before posting my first reply I had tried Late Binding but got the same non
result, ie no error but the popup msgbox wouldn't close without me clicking.
First time forgot to include a button, eventually had to Ctrl-Alt-Del.

Regards,
Peter T

"Norman Jones" wrote in message
...
Hi Gareth,

Out of curiosity, maybe it's the same for you?


I'm afraid not.

My attention span collapsed after 90 secs and I manually closed.

Perhaps, however, I do not have your prodigious sulking ability!

---
Regards,
Norman



"Gareth" wrote in message
...
Hey Norman,

I thought that originally - but then (I don't know why) I sulked and
refused to click it away and it disappeared of its own volition after
about 40". Out of curiosity, maybe it's the same for you?

Indeed, I decided to change the SecondsToWait parameter and the results
were as follows:

Sec nn:ss
1 - 00:03
2 - 02:08
3 - 00:27
3 - 00:07
4 - 00:27
5 - 00:19

Clearly inconsistent - makes this somewhat unusable.

Thanks,
Gareth

Norman Jones wrote:
Hi Peter,


Unlike you I don't get an error, but it just doesn't work as expected


My experience replicates yours, albeit with a xl2k/winXp configuration:
the message box appears (without error) but requires manual dismissal.

---
Regards,
Norman



"Peter T" <peter_t@discussions wrote in message
...

I should have made clear there's quite a difference in the way things
don't
work for us. You said -
"
But I get an error message and the sub stops at the line
<Dim SH As IWshRuntimeLibrary.WshShell
"
Unlike you I don't get an error, but it just doesn't work as expected.

Regards,
Peter T







Gareth[_6_]

message box transient -sub by Chip Perason
 
Ah.... so few do these days. It's a lost art!

;-)

Norman Jones wrote:
Hi Gareth,


Out of curiosity, maybe it's the same for you?



I'm afraid not.

My attention span collapsed after 90 secs and I manually closed.

Perhaps, however, I do not have your prodigious sulking ability!

---
Regards,
Norman



"Gareth" wrote in message
...

Hey Norman,

I thought that originally - but then (I don't know why) I sulked and
refused to click it away and it disappeared of its own volition after
about 40". Out of curiosity, maybe it's the same for you?

Indeed, I decided to change the SecondsToWait parameter and the results
were as follows:

Sec nn:ss
1 - 00:03
2 - 02:08
3 - 00:27
3 - 00:07
4 - 00:27
5 - 00:19

Clearly inconsistent - makes this somewhat unusable.

Thanks,
Gareth

Norman Jones wrote:

Hi Peter,



Unlike you I don't get an error, but it just doesn't work as expected


My experience replicates yours, albeit with a xl2k/winXp configuration:
the message box appears (without error) but requires manual dismissal.

---
Regards,
Norman



"Peter T" <peter_t@discussions wrote in message
...


I should have made clear there's quite a difference in the way things
don't
work for us. You said -
"
But I get an error message and the sub stops at the line
<Dim SH As IWshRuntimeLibrary.WshShell
"
Unlike you I don't get an error, but it just doesn't work as expected.

Regards,
Peter T





Gareth[_6_]

message box transient -sub by Chip Perason
 
Hey Peter - Just in case you're interested, I just tried with late
binding. It works as previously for me i.e. goes away eventually but
with varying durations (albeit seemingly a little closer to the seconds
value passed).


Peter T wrote:
Hi Norman,

I was anticipating coming back to this thread needing to start my reply
with -Doh...! So I'm rather glad you report similar.

Gareth's observations are interesting, but like you I don't have enough
"sulking ability" to see for myself!

No doubt there's some simple explanation, but whatever it is in the light of
our experiences it suggests the method cannot be distributed reliably, a
shame.

Dave - re your suggestion in another part of this thread:
Before posting my first reply I had tried Late Binding but got the same non
result, ie no error but the popup msgbox wouldn't close without me clicking.
First time forgot to include a button, eventually had to Ctrl-Alt-Del.

Regards,
Peter T

"Norman Jones" wrote in message
...

Hi Gareth,


Out of curiosity, maybe it's the same for you?


I'm afraid not.

My attention span collapsed after 90 secs and I manually closed.

Perhaps, however, I do not have your prodigious sulking ability!

---
Regards,
Norman



"Gareth" wrote in message
...

Hey Norman,

I thought that originally - but then (I don't know why) I sulked and
refused to click it away and it disappeared of its own volition after
about 40". Out of curiosity, maybe it's the same for you?

Indeed, I decided to change the SecondsToWait parameter and the results
were as follows:

Sec nn:ss
1 - 00:03
2 - 02:08
3 - 00:27
3 - 00:07
4 - 00:27
5 - 00:19

Clearly inconsistent - makes this somewhat unusable.

Thanks,
Gareth

Norman Jones wrote:

Hi Peter,



Unlike you I don't get an error, but it just doesn't work as expected


My experience replicates yours, albeit with a xl2k/winXp configuration:
the message box appears (without error) but requires manual dismissal.

---
Regards,
Norman



"Peter T" <peter_t@discussions wrote in message
.. .


I should have made clear there's quite a difference in the way things
don't
work for us. You said -
"
But I get an error message and the sub stops at the line
<Dim SH As IWshRuntimeLibrary.WshShell
"
Unlike you I don't get an error, but it just doesn't work as expected.

Regards,
Peter T






Norman Jones

message box transient -sub by Chip Perason
 
Hi Peter,

I was anticipating coming back to this thread needing to start my reply
with -Doh...! So I'm rather glad you report similar.


I have now found this post from Tom Ogilvy:

http://tinyurl.com/bc5vy


---
Regards,
Norman



"Peter T" <peter_t@discussions wrote in message
...
Hi Norman,

I was anticipating coming back to this thread needing to start my reply
with -Doh...! So I'm rather glad you report similar.

Gareth's observations are interesting, but like you I don't have enough
"sulking ability" to see for myself!

No doubt there's some simple explanation, but whatever it is in the light
of
our experiences it suggests the method cannot be distributed reliably, a
shame.

Dave - re your suggestion in another part of this thread:
Before posting my first reply I had tried Late Binding but got the same
non
result, ie no error but the popup msgbox wouldn't close without me
clicking.
First time forgot to include a button, eventually had to Ctrl-Alt-Del.

Regards,
Peter T




Peter T

message box transient -sub by Chip Perason
 
Hi Norman,

So we're not alone, I couldn't follow the link Tom referred to but his
comments are enough. Adds weight to this not being a reliable method.

Not sure if relevant but I notice in the OP's quote of the routine and in
okaizawa's they both mention (ver 1.0) appended to the reference
description. No version info appears in my description and if Gareth quoted
in full in his first post likewise for him.

I got the detailed version info I mentioned previously by rt-clicking
WSHOM.OCX and checking properties.

Gareth - following your latest I tried to be a little bit sulky and tried
Early & Late binding again. Left for quite a while but the message would not
disappear without, as Norman said, manual dismissal. Wouldn't even work with
verbal dismissal of the ancient kind, but it made me feel better.

Regards,
Peter T


"Norman Jones" wrote in message
...
Hi Peter,

I was anticipating coming back to this thread needing to start my reply
with -Doh...! So I'm rather glad you report similar.


I have now found this post from Tom Ogilvy:

http://tinyurl.com/bc5vy


---
Regards,
Norman



"Peter T" <peter_t@discussions wrote in message
...
Hi Norman,

I was anticipating coming back to this thread needing to start my reply
with -Doh...! So I'm rather glad you report similar.

Gareth's observations are interesting, but like you I don't have enough
"sulking ability" to see for myself!

No doubt there's some simple explanation, but whatever it is in the

light
of
our experiences it suggests the method cannot be distributed reliably, a
shame.

Dave - re your suggestion in another part of this thread:
Before posting my first reply I had tried Late Binding but got the same
non
result, ie no error but the popup msgbox wouldn't close without me
clicking.
First time forgot to include a button, eventually had to Ctrl-Alt-Del.

Regards,
Peter T






Gareth[_6_]

message box transient -sub by Chip Perason
 
<Wouldn't even work with verbal dismissal LOL

FWIW, my version is 5.6.0.8820, 96.0 KB (98,304 bytes). Oh, and yup -
you're quite right to assume I quoted the ref name exactly as it is
written i.e. no Ver1.0.

cya,
Gareth

Peter T wrote:
Hi Norman,

So we're not alone, I couldn't follow the link Tom referred to but his
comments are enough. Adds weight to this not being a reliable method.

Not sure if relevant but I notice in the OP's quote of the routine and in
okaizawa's they both mention (ver 1.0) appended to the reference
description. No version info appears in my description and if Gareth quoted
in full in his first post likewise for him.

I got the detailed version info I mentioned previously by rt-clicking
WSHOM.OCX and checking properties.

Gareth - following your latest I tried to be a little bit sulky and tried
Early & Late binding again. Left for quite a while but the message would not
disappear without, as Norman said, manual dismissal. Wouldn't even work with
verbal dismissal of the ancient kind, but it made me feel better.

Regards,
Peter T


"Norman Jones" wrote in message
...

Hi Peter,


I was anticipating coming back to this thread needing to start my reply
with -Doh...! So I'm rather glad you report similar.


I have now found this post from Tom Ogilvy:

http://tinyurl.com/bc5vy


---
Regards,
Norman



"Peter T" <peter_t@discussions wrote in message
...

Hi Norman,

I was anticipating coming back to this thread needing to start my reply
with -Doh...! So I'm rather glad you report similar.

Gareth's observations are interesting, but like you I don't have enough
"sulking ability" to see for myself!

No doubt there's some simple explanation, but whatever it is in the


light

of
our experiences it suggests the method cannot be distributed reliably, a
shame.

Dave - re your suggestion in another part of this thread:
Before posting my first reply I had tried Late Binding but got the same
non
result, ie no error but the popup msgbox wouldn't close without me
clicking.
First time forgot to include a button, eventually had to Ctrl-Alt-Del.

Regards,
Peter T






Gareth[_6_]

message box transient -sub by Chip Perason
 
In a nutshell, late binding is not declaring your objects at design
time, rather you let them be resolved at runtime. It's therefore written
in the code and so whether or not the OCX is referenced in the VBA
project is not important: if you use late binding - it's irrelevant.
(That's not very clear is it!)

Normally early binding is better and faster, as in your original post:

Dim SH As IWshRuntimeLibrary.WshShell
Set SH = New IWshRuntimeLibrary.WshShell

rather than late binding (from Dave Peterson's email)

Dim SH As Object
Set SH = CreateObject("wscript.shell")

But occasionally late binding can be useful - for example here Dave was
hoping it might fix your problem. (Which appears to be insolvable.)

Take a look at CreateObject Function in VBA Help for more info on late
and early binding.

With respect to your OP - I think the consensus is to go with userforms!

HTH


R.VENKATARAMAN wrote:
apologise for asking a dumb question. what is late binding. what should I
do.
I removed the tick from the reference list.
still sub stops at

Res=etc. etc..

error
<named argument not found
================================
Dave Peterson wrote in message
...

You could also use late binding and drop the reference:

Dim SH As Object
Dim Res As Long
Set SH = CreateObject("wscript.shell")
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)



"R.VENKATARAMAN" wrote:

In one of my serches in googles group I found pearson's sub on having a
transient message box

quote
Dim SH As IWshRuntimeLibrary.WshShell
Dim Res As Long
Set SH = New IWshRuntimeLibrary.WshShell
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)
unquote

as suggested i have referenced in vbeditor tools references

<windows scripting host object model(ver 1.0)

and then run the above sub
But I get an error message and the sub stops at the line

<Dim SH As IWshRuntimeLibrary.WshShell

the error mesage is
<user defined type not defind

where I am doing the mistake

mine excel 2000
windows 98SE

request help
thanks regards.


--

Dave Peterson





R.VENKATARAMAN

message box transient -sub by Chip Perason
 
as the orginator of the thread I am extremely surprised and also happy that
as an innocent I was the cause of inviting large number of responses. Of
course no final solution is reached. But that does not matter. The large
number of messages show how the newsgroup and particularly the experts in
the group try to help even novices. it is a great newsgroup which I browse
for the past more than five years and was and is responsible for myself
learning excel and vba to some extent. thanks a lot to all of you.




Gareth wrote in message
...
In a nutshell, late binding is not declaring your objects at design
time, rather you let them be resolved at runtime. It's therefore written
in the code and so whether or not the OCX is referenced in the VBA
project is not important: if you use late binding - it's irrelevant.
(That's not very clear is it!)

Normally early binding is better and faster, as in your original post:

Dim SH As IWshRuntimeLibrary.WshShell
Set SH = New IWshRuntimeLibrary.WshShell

rather than late binding (from Dave Peterson's email)

Dim SH As Object
Set SH = CreateObject("wscript.shell")

But occasionally late binding can be useful - for example here Dave was
hoping it might fix your problem. (Which appears to be insolvable.)

Take a look at CreateObject Function in VBA Help for more info on late
and early binding.

With respect to your OP - I think the consensus is to go with userforms!

HTH


R.VENKATARAMAN wrote:
apologise for asking a dumb question. what is late binding. what should

I
do.
I removed the tick from the reference list.
still sub stops at

Res=etc. etc..

error
<named argument not found
================================
Dave Peterson wrote in message
...

You could also use late binding and drop the reference:

Dim SH As Object
Dim Res As Long
Set SH = CreateObject("wscript.shell")
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)



"R.VENKATARAMAN" wrote:

In one of my serches in googles group I found pearson's sub on having a
transient message box

quote
Dim SH As IWshRuntimeLibrary.WshShell
Dim Res As Long
Set SH = New IWshRuntimeLibrary.WshShell
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)
unquote

as suggested i have referenced in vbeditor tools references

<windows scripting host object model(ver 1.0)

and then run the above sub
But I get an error message and the sub stops at the line

<Dim SH As IWshRuntimeLibrary.WshShell

the error mesage is
<user defined type not defind

where I am doing the mistake

mine excel 2000
windows 98SE

request help
thanks regards.

--

Dave Peterson







Ivan F Moala[_64_]

message box transient -sub by Chip Perason
 

You could try using API's

Have a look here

http://www.xcelfiles.com/API_02.htm

--
Ivan F Moal

-----------------------------------------------------------------------
Ivan F Moala's Profile: http://www.excelforum.com/member.php...nfo&userid=195
View this thread: http://www.excelforum.com/showthread.php?threadid=38780


R.VENKATARAMAN

message box transient -sub by Chip Perason
 
thank you. shall try

Ivan F Moala
wrote in message
news:Ivan.F.Moala.1sd12e_1121681107.4861@excelforu m-nospam.com...

You could try using API's

Have a look here

http://www.xcelfiles.com/API_02.html


--
Ivan F Moala


------------------------------------------------------------------------
Ivan F Moala's Profile:

http://www.excelforum.com/member.php...fo&userid=1954
View this thread: http://www.excelforum.com/showthread...hreadid=387808




Dave Peterson

message box transient -sub by Chip Perason
 
Just to add...

I like to use early binding while developing the project. You get all those
intellisense and autocomplete features in the VBE.

But when I'm ready to release it to others, I'll get rid of the references,
declare any constants I used and fix my DIMs to be more generic (As Object).

This means I don't have to worry about version differences--I use version 12 and
someone else uses version 11, my program might break, because of missing
references.

But early/late binding wasn't ever going to fix the problem that the dialog
doesn't dismiss itself. (When I wrote my message, I still thought it was a "how
do I create a reference" problem.)

Gareth wrote:

In a nutshell, late binding is not declaring your objects at design
time, rather you let them be resolved at runtime. It's therefore written
in the code and so whether or not the OCX is referenced in the VBA
project is not important: if you use late binding - it's irrelevant.
(That's not very clear is it!)

Normally early binding is better and faster, as in your original post:

Dim SH As IWshRuntimeLibrary.WshShell
Set SH = New IWshRuntimeLibrary.WshShell

rather than late binding (from Dave Peterson's email)

Dim SH As Object
Set SH = CreateObject("wscript.shell")

But occasionally late binding can be useful - for example here Dave was
hoping it might fix your problem. (Which appears to be insolvable.)

Take a look at CreateObject Function in VBA Help for more info on late
and early binding.

With respect to your OP - I think the consensus is to go with userforms!

HTH

R.VENKATARAMAN wrote:
apologise for asking a dumb question. what is late binding. what should I
do.
I removed the tick from the reference list.
still sub stops at

Res=etc. etc..

error
<named argument not found
================================
Dave Peterson wrote in message
...

You could also use late binding and drop the reference:

Dim SH As Object
Dim Res As Long
Set SH = CreateObject("wscript.shell")
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)



"R.VENKATARAMAN" wrote:

In one of my serches in googles group I found pearson's sub on having a
transient message box

quote
Dim SH As IWshRuntimeLibrary.WshShell
Dim Res As Long
Set SH = New IWshRuntimeLibrary.WshShell
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)
unquote

as suggested i have referenced in vbeditor tools references

<windows scripting host object model(ver 1.0)

and then run the above sub
But I get an error message and the sub stops at the line

<Dim SH As IWshRuntimeLibrary.WshShell

the error mesage is
<user defined type not defind

where I am doing the mistake

mine excel 2000
windows 98SE

request help
thanks regards.

--

Dave Peterson





--

Dave Peterson

Gareth[_6_]

message box transient -sub by Chip Perason
 
Hi Dave,

I didn't mean to give the impression you were suggesting late binding
would fix the box not dismissing itself. Rather, the OP's problem was
that he couldn't get it to even compile, on his 98SE machine, past the
wshshell declaration. As a fix for that, it seemed like a good
suggestion. Sorry if it wasn't clear.

Best regards,
Gareth

Dave Peterson wrote:
Just to add...

I like to use early binding while developing the project. You get all those
intellisense and autocomplete features in the VBE.

But when I'm ready to release it to others, I'll get rid of the references,
declare any constants I used and fix my DIMs to be more generic (As Object).

This means I don't have to worry about version differences--I use version 12 and
someone else uses version 11, my program might break, because of missing
references.

But early/late binding wasn't ever going to fix the problem that the dialog
doesn't dismiss itself. (When I wrote my message, I still thought it was a "how
do I create a reference" problem.)

Gareth wrote:

In a nutshell, late binding is not declaring your objects at design
time, rather you let them be resolved at runtime. It's therefore written
in the code and so whether or not the OCX is referenced in the VBA
project is not important: if you use late binding - it's irrelevant.
(That's not very clear is it!)

Normally early binding is better and faster, as in your original post:

Dim SH As IWshRuntimeLibrary.WshShell
Set SH = New IWshRuntimeLibrary.WshShell

rather than late binding (from Dave Peterson's email)

Dim SH As Object
Set SH = CreateObject("wscript.shell")

But occasionally late binding can be useful - for example here Dave was
hoping it might fix your problem. (Which appears to be insolvable.)

Take a look at CreateObject Function in VBA Help for more info on late
and early binding.

With respect to your OP - I think the consensus is to go with userforms!

HTH

R.VENKATARAMAN wrote:

apologise for asking a dumb question. what is late binding. what should I
do.
I removed the tick from the reference list.
still sub stops at

Res=etc. etc..

error
<named argument not found
================================
Dave Peterson wrote in message
...


You could also use late binding and drop the reference:

Dim SH As Object
Dim Res As Long
Set SH = CreateObject("wscript.shell")
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)



"R.VENKATARAMAN" wrote:


In one of my serches in googles group I found pearson's sub on having a
transient message box

quote
Dim SH As IWshRuntimeLibrary.WshShell
Dim Res As Long
Set SH = New IWshRuntimeLibrary.WshShell
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)
unquote

as suggested i have referenced in vbeditor tools references

<windows scripting host object model(ver 1.0)

and then run the above sub
But I get an error message and the sub stops at the line

<Dim SH As IWshRuntimeLibrary.WshShell

the error mesage is
<user defined type not defind

where I am doing the mistake

mine excel 2000
windows 98SE

request help
thanks regards.

--

Dave Peterson





Dave Peterson

message box transient -sub by Chip Perason
 
Not a problem.

Gareth wrote:

Hi Dave,

I didn't mean to give the impression you were suggesting late binding
would fix the box not dismissing itself. Rather, the OP's problem was
that he couldn't get it to even compile, on his 98SE machine, past the
wshshell declaration. As a fix for that, it seemed like a good
suggestion. Sorry if it wasn't clear.

Best regards,
Gareth

Dave Peterson wrote:
Just to add...

I like to use early binding while developing the project. You get all those
intellisense and autocomplete features in the VBE.

But when I'm ready to release it to others, I'll get rid of the references,
declare any constants I used and fix my DIMs to be more generic (As Object).

This means I don't have to worry about version differences--I use version 12 and
someone else uses version 11, my program might break, because of missing
references.

But early/late binding wasn't ever going to fix the problem that the dialog
doesn't dismiss itself. (When I wrote my message, I still thought it was a "how
do I create a reference" problem.)

Gareth wrote:

In a nutshell, late binding is not declaring your objects at design
time, rather you let them be resolved at runtime. It's therefore written
in the code and so whether or not the OCX is referenced in the VBA
project is not important: if you use late binding - it's irrelevant.
(That's not very clear is it!)

Normally early binding is better and faster, as in your original post:

Dim SH As IWshRuntimeLibrary.WshShell
Set SH = New IWshRuntimeLibrary.WshShell

rather than late binding (from Dave Peterson's email)

Dim SH As Object
Set SH = CreateObject("wscript.shell")

But occasionally late binding can be useful - for example here Dave was
hoping it might fix your problem. (Which appears to be insolvable.)

Take a look at CreateObject Function in VBA Help for more info on late
and early binding.

With respect to your OP - I think the consensus is to go with userforms!

HTH

R.VENKATARAMAN wrote:

apologise for asking a dumb question. what is late binding. what should I
do.
I removed the tick from the reference list.
still sub stops at

Res=etc. etc..

error
<named argument not found
================================
Dave Peterson wrote in message
...


You could also use late binding and drop the reference:

Dim SH As Object
Dim Res As Long
Set SH = CreateObject("wscript.shell")
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)



"R.VENKATARAMAN" wrote:


In one of my serches in googles group I found pearson's sub on having a
transient message box

quote
Dim SH As IWshRuntimeLibrary.WshShell
Dim Res As Long
Set SH = New IWshRuntimeLibrary.WshShell
Res = SH.Popup(Text:="Click Me", secondstowait:=5, _
Title:="Hello, World", Type:=vbOKOnly)
unquote

as suggested i have referenced in vbeditor tools references

<windows scripting host object model(ver 1.0)

and then run the above sub
But I get an error message and the sub stops at the line

<Dim SH As IWshRuntimeLibrary.WshShell

the error mesage is
<user defined type not defind

where I am doing the mistake

mine excel 2000
windows 98SE

request help
thanks regards.

--

Dave Peterson





--

Dave Peterson


All times are GMT +1. The time now is 11:35 PM.

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