use namespace in VB.NET

  • Thread starter Thread starter Maileen
  • Start date Start date
M

Maileen

Hi,

I would like to know how can we use a namespace in VB.NET ?
i tried :
Imports xlApp = Microsoft.Office.Interop.Excel
and
Dim test As New Microsoft.Office.Interop.Excel

but without success.
First i install PIA for Office XP and include the COM as usual.
Is there something else to do first ?

thanks a lot,
Maileen
 
Maileen,
First i install PIA for Office XP and include the COM as usual.
Is there something else to do first ?
What do you mean "include the COM as usual"?

You need to install the PIA first as you did. Then you use "Project - Add
Reference - COM" and select Microsoft Excel, VS.NET will see that there is a
PIA available and use the PIA.

After you add the reference you should be able to import the namespace. You
may want to use Object Browser, after you Add Reference, to ensure that you
are using the correct namespace, as I seem to remember that the namespaces
differ when you are using a PIA or not.

Hope this helps
Jay
 
Back
Top