View Single Post
  #15   Report Post  
Posted to microsoft.public.excel.programming
R.VENKATARAMAN R.VENKATARAMAN is offline
external usenet poster
 
Posts: 110
Default 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