message box transient -sub by Chip Perason

  • Thread starter Thread starter R.VENKATARAMAN
  • Start date Start date
<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
 
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 said:
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>
================================
 
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 said:
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
 
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.)
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
 
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
 
Not a problem.
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top