Using Directive

If you are using several objects from the same namespace you can save typing by adding the necessary using directive to the top of your program


If you do not want to fully qualify your namespaces you can use the using directive.
This provides a way of importing a namespace so it does not have to be fully qualified.


The main use of the using directive is to be able to refer to types without having to fully qualify them all.

using System 
Imports System 


Using Alias Directive

This can be used to create an alias for a namespace or a type.
The right side of a using alias directive must always be fully qualified.

using Excel = Microsoft.Office.Excel 
Imports Excel = Microsoft.Office.Excel 


Using Statement

The using directive is not to be confused with the Using Statement which is used for defining the scope of objects.



© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited TopPrevNext