>What's the difference between using New or CreateObject?.
>Is there performance reasons or rules about use one of them?.
>
>Your help will be very useful!!!
>
>Thanks guys!!!!
You can reference an object using early or late binding.
Using CreateObject, you use late binding. VB does not know of the object until the code is executed. VB can't use Intellisence to display the properties and methods in the code window and cannot check your code. Another downside to late binding is that it is slower. One benefit is that since there's no reference to the object, if it does not exist on the user's PC, your app can run and you can trap the error when trying to create the object. Another usefull use of late binding is that you can distribute new version of your objects without recompile your app.
When you put a reference to an object and use declare a variable with the New keyword, you use early binding. Benefits are: a lot faster then late binding, code checking, Intellisence.